-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to mix multiple colors in different proportions, not just 2 colors #6
Comments
When I find the time I will look in to this |
Hi, there, I have the same need: I need to translate this kind of thing: mixbox_latent finalLat = 0.2 * latUp + 0.3 * latDown + 0.4 * latLeft + 0.1 * latRight; The context would be
Thanks! |
It’s coming, I have this in my dev version. |
Hi @rvanwijnen, Thanks for this great library. It really helps to understand how to implement the Kubelka-Munk theory. I'm trying to adapt the existing code to support mixing more than 2 colors. function linear_to_concentration(l1, l2, t) {
let t1 = l1 * (1 - t) ** 2;
let t2 = l2 * t ** 2;
return t2 / (t1 + t2);
} In the comment to #10 and comment to #13 you wrote:
How did you come up with this solution? Maybe you can share some references? The following function graph shows the difference between linear (y=x) and |
It looks like the most practical way to mix 3 or more colors is iteratively. Each next color have to be mixed with the mixture of previous two colors. Mix first two colors, then mix the resulting mixture with the third color, then mix the resulting mixture with the fourth color and so on. Mix 3 colors in 1:1:1 ratio:
This approach can be extended on any number of colors. |
it would be awesome if I could play around with mixing multiple (2+) colors.
In fact I will try to implement it in the active project as soon as several colors are available.
Here are a few examples of implementation:
The text was updated successfully, but these errors were encountered: