I want to mix colors like you would with paint or light.
Does anyone know of some efficient formulas or tools to get the job done? It should be simple but so far it's not.
For instance, if you mix yellow and blue, you should green
However, you get gray!!!
The problem is that css uses RGB which I find truly baffling. For some reason, "yellow" is represented by green and red. That is to say: rgb(255,255,0)="yellow"!
I'm sure there's some reason behind all this, but the math is now funky.
Let's say you use JavaScript to mix yellow and blue to get green. You get:
var green = rgb(
Math.round( ( 255 + 0 ) / 2 = **128** ),
Math.round( ( 255 + 0 ) / 2 = **128** ),
Matn.round( ( 0 + 255 ) / 2 = **128** )
)
= rgb(128,128,128)
That's gray.
Any insights into this conundrum would make me a very satisfied coder and might even help me make a cool app.
TY in advance.