So I have color “B” at 100% opacity.

I need a way of finding the color “A” that looks exactly the same as the above when it is at 90% opacity.Assume that background is pure white but I don’t think that matters as long as it’s the same color on both instances.

How can this be done?

**Answer**

Result of normal alpha blending is:

*C*_{out} = *α* * *C*_{FG}+(1-*α*) * *C*_{BG}

where *C*_{FG} is the foreground color and *C*_{BG} is the background color and *α* is the opacity. Thus you want to solve A from equation:

*B* = 0.9 * *A* + (1-0.9) * *C*_{BG}

Which after manipulation is:

*A* = (*B* – 0.1 * *C*_{BG}) / 0.9

further assuming white color the formula per color channel is:

*A* = (*B* – 0.1) / 0.9

While this is the general answer, there is a **big caveat** associated with this calculation. This does not account for any color management. So you might need to convert the color to linear and then back to the original color space to do this calculation. There is also a second consideration to think about: The color you may need to use can exit the displayable gamut of your system.

**Attribution***Source : Link , Question Author : Help Leecher , Answer Author : joojaa*