-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
New API to normalize color values without NaN. #479
Comments
My comment was:
I’m envisioning a function that would take a single color as its first argument, and optionally a variable number of other colors which would be used to resolve
We could also then add a |
I just wanted to chip in and say that I'd appreciate a new |
Are there cases where Color.js output |
(Not at a big computer right now) For me, the latter. I had converted a bunch of custom color conversion algorithms with test coverage to use colorjs.io instead and saw a series of tests fail that passed previously on account of 0 values now being NaN/none (depending on which colorjs.io version I used) |
If you’re gonna pass them through a function, something like this should probably do the trick: function removeNone (color) {
let color2 = new Color(color.space, [0, 0, 0]);
return color.mix(color2, 0, {space: color.space});
} We could consider adding it to the core if there's demand, but I would refrain from adding it based on a single use case. |
#476 (comment)
The text was updated successfully, but these errors were encountered: