Closed nickofthyme closed 4 years ago
When using an alpha value with d3.rgb, via rgba or hsla colors strings, the color values return NaN.
d3.rgb
rgba
hsla
NaN
Is this expected behavior?
tested on d3-color@1.4.0
d3-color@1.4.0
d3.rgb('hsla(240,100%,25%,0)'); // returns { r: NaN, b: NaN, g: NaN, opacity: 0, }
d3.rgb('rgba(0,0,0,0)'); // returns { r: NaN, b: NaN, g: NaN, opacity: 0, }
Also interesting to note that the behavior of non-zero, but close to zero, alpha values return the expected color.
d3.rgb('rgba(0,0,0,0.001)'); // returns { r: 0, b: 0, g: 0, opacity: 0.001, }
duplicate of #52
When using an alpha value with
d3.rgb
, viargba
orhsla
colors strings, the color values returnNaN
.Is this expected behavior?
Also interesting to note that the behavior of non-zero, but close to zero, alpha values return the expected color.