-
Is there a feature/plugin of d3 that allows the mixing of colors? I'm looking for something like SCSS's I don't think I can just have the browser engine render things and get the final pixel color that way. Rendering to a Alternative suggestions most welcome, but I quite like how d3-color works and would love to try d3-color-difference alongside it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nevermind. Turns out |
Beta Was this translation helpful? Give feedback.
Nevermind. Turns out
d3.rgb(d3.interpolateRgb(a, b)(w))
gives the same output as SCSSmix(a, b, (1 - w) * 100))
(i.e.mix(b, a, w * 100)
). I made a mistake while comparing the output, which had me convinced they behaved differently away from the midpoint.