Real Life Color Mixing

Hey Everyone…

I’m curious if anyone has ever worked enough with the ColorTransform (or any other) classes in AS3 that would allow you to mix colors as they would mix in real life… I’m not sure if there is a proper algorithm for RGB addition or anything, but I cannot seem to get it working.

The most accurate I have found thus far is something along the lines of

New Color R = min((c1.r + c2.r) / 2, 255)
New Color G = min((c1.g + c2.g) / 2, 255)
New Color B = min((c1.b + c2.b) / 2, 255)

But with this, if I try to mix yellow with blue, I get a grey (RGB val = 127, 127, 127)

Does anyone know how I may be able to achieve this?

Thanks!

–d