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

Got hue value NaN from chroma('#000000').oklch() #322

Closed
hallee9000 opened this issue Jan 22, 2024 · 2 comments
Closed

Got hue value NaN from chroma('#000000').oklch() #322

hallee9000 opened this issue Jan 22, 2024 · 2 comments

Comments

@hallee9000
Copy link

image

regorxxx added a commit to regorxxx/chroma.js that referenced this issue Feb 4, 2024
… with no hue (like black, white or grays) in color spaces which work internally with hue values (like LCH, HSL, ...). By default these colors returned a NaN hue value, but this behavior can now be changed to output always zero by using "chroma.noHueAsZero(true)" first at any time. See [Issue 322](gka#322)

* minor improvements to documentation

Signed-off-by: regorxxx <[email protected]>
@regorxxx
Copy link

regorxxx commented Feb 4, 2024

See this #321
Read the docs, it's intended that colors with no hue should return NaN.

On the updated repo there is a way to change this behavior.

@gka
Copy link
Owner

gka commented Aug 14, 2024

as explained by @regorxxx , this is the intended behavior and it's explained in the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants