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

d3.hsl doesnt seem to work with grey scale values #73

Closed
nonmetalhail opened this issue Apr 15, 2020 · 2 comments
Closed

d3.hsl doesnt seem to work with grey scale values #73

nonmetalhail opened this issue Apr 15, 2020 · 2 comments

Comments

@nonmetalhail
Copy link

Seems like whenever I have a color where the saturation is 0% or the lightness is 0% or 100%, I get NaN values in the returned color object.

Easiest to see the various examples here:
https://observablehq.com/d/f7636f7695376a03

But, for example:
d3.hsl('#ffffff') returns {h: NaN, s: NaN, l: 1, opacity: 1}

@mbostock
Copy link
Member

This is intended. See:

https://observablehq.com/@d3/achromatic-interpolation

@mootari
Copy link

mootari commented Apr 18, 2020

Might be a good idea to add a note to the readme (unless it's already there and I missed it)?

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

No branches or pull requests

3 participants