-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Ensure alpha is a number in Color constructor #400
Conversation
✅ Deploy Preview for colorjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Co-authored-by: Lea Verou <lea@verou.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before, alpha
could be passed in as NaN
and it would be retained as such -- this now coerces it to 1
. Is that intentional?
You're right, I think we need to allow The Lines 27 to 29 in 44f3741
Should |
Oh good point. We do plan to eventually use |
I've added some additional constructor tests for NaN/none/clamping and alpha is set to 1 only if it's > 1 or undefined. |
Fixes two failing constructor tests.