N
N
nyver2012-05-18 09:11:09
Java
nyver, 2012-05-18 09:11:09

Algorithm for natural mixing of two colors?

Given: two RGB colors. You need to mix two colors and show the result. For example Blue + Yellow = Green.
I understand mixing RGB and CMYK does not give realistic results. I saw a mention of Kubelka and Munk on the net, but I could not find examples of implementation or an intelligible description anywhere.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
T
Tadeus, 2012-05-18
@nyver

Like on canvas - it's not RGB, it's RYB
Google can easily find how to convert from RGB to RYB

B
bagyr, 2012-05-18
@bagyr

Linear interpolation over Hue in HSV? Works with blue and yellow.

A
Anton Alisov, 2012-05-18
@alan008

Averaging won't work?
R = (R1 + R2) div 2
G = (G1 + G2) div 2
B = (B1 + B2) div 2

M
m_z, 2012-05-18
@m_z

The question is about C# , but porting to Java will not be difficult.

E
Evgeny Bezymyannikov, 2012-05-18
@psman

a - alpha from 0 to 1
R= R1*a + R2*(1-a) - if we set transparency
, it is not clear what is not to like in the "realism" of blending?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question