Closed SlowMo24 closed 2 years ago
You could convert colors to RGBA format using d3.rgb
.
const { r, g, b, opacity } = d3.rgb(color);
const formatted = `rgba(${r},${g},${b},${opacity})`;
ah nice, thank you! I didn't know about that function (and solved it with string replacement, but this is nicer).
I would like to have
rgba
-values as output. I cannot find that option so I guess this would need an extension to the existing color-getter-functions to accept an optional alpha-value?