d3 / d3-color

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

Update color.js #70

Closed hzzcc closed 4 years ago

hzzcc commented 4 years ago

parse color like 'rgba(255, 0, 0, 0)'

mbostock commented 4 years ago

If you want to construct that sort of color, you have to use the constructor directly rather than parsing a CSS string. Achromatic CSS colors have NaN values for RGB.