Calculate resulting RGB from 2 colors, one is transparent

I'm looking for a formula to convert them.

I know to convert a general transparency it is

alpha * new + ( 1 - alpha ) * old

I have:

Color A : RGB( 85, 113, 135 )
Color B : RGB( 43, 169, 225 )

Color A has 90% opacity and is laid on top of Color B, resulting in

Color C : RGB( 65, 119, 145 )

My question is, how does it get Color C? If I substitute Color B for another thing, how do I get Color C?

Here's another example, same base color:

Color A : RGB( 85, 113, 135 )
Color B : RGB( 45, 67, 82 )
--------
Color C : RGB( 65, 109, 131 )

Those are working examples done with images -- I'm trying to now calculate the remaining Color C so I can assign a background color.


UPDATE, please see the accepted answer. The red in the above examples is strange -- the accepted answer has the correct formula for all the colors, I tested it in Photoshop.

6
задан Kerry Jones 18 August 2010 в 18:04
поделиться