d3 / d3-color

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

Some alpha-values not recognized #31

Closed rivo closed 7 years ago

rivo commented 7 years ago

The following is a valid color (black with 50% opacity) but will not be recognized:

d3.color("rgba(0,0,0,.5)") === null // true

It seems that at least one digit is always required before the decimal point. I believe this can be fixed in the corresponding regex.

rivo commented 7 years ago

Great, thanks!