-
Notifications
You must be signed in to change notification settings - Fork 92
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
use d3.color('rgba(255,255,255,0)'), the rgb is all NaN. #52
Comments
The color parser treats transparent colors as having undefined R, G and B values because CSS does not support an explicit way of representing undefined channel values and therefore supporting achromatic interpolation. If you want to construct a transparent color with defined R, G and B values, you need to use the d3.rgb constructor instead: d3.rgb(255, 255, 255, 0) |
Is this intentionally different functionality for hexadecimal colors? d3.rgb('#00000000)');
// returns
{
r: 0,
b: 0,
g: 0,
opacity: 0,
} |
That looks like a bug in #67. |
Fixed in f176ff1. |
when i use d3.color parse
rgba(255,255,255,0)
, the result ofr
,g
,b
is NaN.why the
a
is 0, ther
,g
,b
is NaN.The text was updated successfully, but these errors were encountered: