-
Notifications
You must be signed in to change notification settings - Fork 31
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
Interpolator throwing a NaN/undefined #202
Comments
Hi @marcelpi, thanks for logging the issue. You are right that achromatic colors in A separate issue is that |
Thanks for your answer, @danburzo. But I also understand your perspective, my guess is this would also solve the interpolatorSplineMonotone issue. |
In Culori, an Interpolating a color with Here's Chrome rendering ![]() Here is the same gradient, but with ![]() Interpolation with missing components is described here. I will need to investigate which conversions make the wrong assumptions and produce |
Alright, makes sense. Thanks for clearing that out. |
Hey there,
First off, thank you for a wonderful library.
I encountered a bug when trying to interpolate two colors in Lch and okLch space. Everything works fine, except when an interpolated color is black or white and there are more than two colors to interpolate over.
In the example below, I've got 3 colors in the initial color array and something breaks. However, if I delete one of them and start just with two everything works fine.
If I inspect one of the missing colors I notice the CSS property: background: lch(73.90988017397126 107.41130153548478 NaN)
The NaN is probably generating the problem.
Code here: https://codesandbox.io/s/lch-interpolator-wt5yk5?file=/App.svelte
Also, if I put just black and white as starting colors I get background: lch(100.00000139649632 0 undefined) for white and lch(0 0 undefined) for black.
Does this happen because black and white being achromatic colors are missing the h attribute?
The text was updated successfully, but these errors were encountered: