Skip to content
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

Closed
karlvr opened this issue Jan 22, 2013 · 2 comments
Closed

Contrast function does not correctly handle % thresholds #1144

karlvr opened this issue Jan 22, 2013 · 2 comments

Comments

@karlvr
Copy link

karlvr commented Jan 22, 2013

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.

@Synchro
Copy link
Member

Synchro commented Jan 22, 2013

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 ghost assigned Synchro Jan 22, 2013
Synchro added a commit that referenced this issue Jan 22, 2013
Contrast percentage fix for #1144
@karlvr
Copy link
Author

karlvr commented Jan 23, 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
Projects
None yet
Development

No branches or pull requests

2 participants