hughsk / clamp

Clamp a value between two other values.
MIT License
39 stars 5 forks source link

Made clamp much easier to read, added a saturate function. #6

Closed VictorioBerra closed 8 years ago

VictorioBerra commented 8 years ago

Added a saturate function on prototype to avoid breaking backwards compatibility. Added new tests for saturate.

hughsk commented 8 years ago

Hey @LordWingZero, thanks for taking the time to make a PR. I'm not going to merge this — it's essentially a rewrite in both functionality and code style. Legibility isn't very important for a simple function like clamp, especially if it's hidden away in a dependency. You're welcome to publish your fork as an independent package though :)