Combine different colours with opacity to create target colour

I have a javascript where 3 opengl objects overlay each other with (0.5) Alpha/Opacity each. The objects attach to css with .appendChild and are styled with rgb colours. The individual colours of the objects create a custom colour when overlayed. I need the individual colours to create a certain target colour; the background-colour of the section beneath it, so that they merge with it. And no, I don't want them to fade in with a gradient. Alpha does not have to be '0.5'. Each object is styled like this:

context.globalAlpha = 0.5; context.fillStyle = 'red';

Basically I need something like this:

solve(color x + color y + color z = color target)

链接地址: http://www.djcxy.com/p/89160.html

上一篇: CSS Div拉伸100%页面高度

下一篇: 将不同的颜色与不透明度组合以创建目标颜色