d3 / d3-color

Color spaces! RGB, HSL, Cubehelix, CIELAB, and more.
https://d3js.org/d3-color
ISC License
400 stars 91 forks source link

Document hcl functions #24

Closed droundy closed 6 years ago

droundy commented 8 years ago

It would be lovely to have documentation for the argument ranges of the hcl color space, as there is for the other color spaces.

mbostock commented 8 years ago

Did you see the linked HCL Color Picker?

Hue is a degree, from 0° to 360°. Chroma is a percentage, from 0 to 100. I don’t know if the Luminance channel has a strict definition, since it depends on the reference illuminant (D65), other than 0 being black and higher values (up to 100-ish?) being brighter. But d3.hcl doesn’t protect you from creating colors that can’t be represented in RGB on standard hardware; see this post.