Skip to content

Programmatically mix/blend colors? #3526

Answered by adrian5
adrian5 asked this question in Q&A
Discussion options

You must be logged in to vote

Nevermind. Turns out d3.rgb(d3.interpolateRgb(a, b)(w)) gives the same output as SCSS mix(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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adrian5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant