I want to combine the values of two colors. For example:
// color 1:
int aa = 255;
int rr = 255;
int gg = 0;
int bb = 0;
// color 2:
int aa = 128;
int rr = 0;
int gg = 0;
int bb = 0;
The first color is pure red at 100% alpha. The second color is black at 50% alpha. I want to find the final combined color, as if I layered the second color on top of the first, as you could do in photoshop via layers.
What is the formula for doing this? I'm not sure of the correct terminology here, so getting search results that I don't think are what I want.
Thanks