p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Add logValue Method for Range Inputs to p5.Element

Open nimanns opened this issue 1 year ago • 2 comments

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

nimanns avatar Sep 07 '24 02:09 nimanns

🎉 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!

welcome[bot] avatar Sep 07 '24 02:09 welcome[bot]

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.

ashish1729 avatar Sep 07 '24 03:09 ashish1729