Add logValue Method for Range Inputs to p5.Element
Changes: This PR introduces a new method, logValue, to the p5.Element prototype for range () elements. This method allows users to map slider values logarithmically, which is particularly useful for applications like audio volume control, where perception of changes follows a logarithmic rather than linear scale.
Changed files are: src/dom/dom.js and test/unit/dom/dom.js
Screenshots of the change:
PR Checklist
- [x]
npm run lintpasses - [ ] Inline documentation is included / updated
- [x] Unit tests are included / updated
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!
is this based on some issue? I am curious why we add this directly to the element and not create mapping functionality / utillity to the logarithmic domain.