-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contrast function does not correctly handle % thresholds #1144
Labels
Milestone
Comments
Thanks, I suspected there was something in here that wasn't right with percentages. It's easy to show there's a problem as thresholds of 0.1 and 10% do not produce the same result. |
ghost
assigned Synchro
Jan 22, 2013
Brilliant, thanks for the rapid fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It uses threshold.value when it should invoke number(threshold) to correctly convert the percentage to 0-1 range. So if the user passes a percentage the threshold will be > 1 and will always result in returning light.
The test-cases previously used percentages but now have decimal numbers to work around this issue?
I believe changing threshold.value to number(threshold) will correct the issue.
The text was updated successfully, but these errors were encountered: