d3 / d3-color

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

{rgb,hsl}.clamp() #102

Closed mbostock closed 2 years ago

mbostock commented 2 years ago

Related #101.

Fil commented 2 years ago

Is it only rgb and hsl colors that can be clamped? In that case, should we have a default method for the other color types, for API consistence (i.e. an alias of color.copy)?

mbostock commented 2 years ago

Yes, only RGB and HSL. These are “hardware” color spaces whereas the other ones are more abstract.