Closed FEliuyg closed 5 years ago
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 f176ff11d69195a06dc478bd80c33d26411bf3c7.
when i use d3.color parse
rgba(255,255,255,0)
, the result ofr
,g
,b
is NaN. why thea
is 0, ther
,g
,b
is NaN.