Mobile app version of vmapp.org
Login or Join
Frith110

: How to find the color "A" that would look exactly the same as 100% opacity color "B" when it is at 90% opacity? So I have color "B" at 100% opacity. I need a way of finding the color "A"

@Frith110

Posted in: #Color

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith110

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gail6891361

Result of normal alpha blending is:

Cout = α * CFG+(1-α) * CBG

where CFG is the foreground color and CBG is the background color and α is the opacity. Thus you want to solve A from equation:

B = 0.9 * A + (1-0.9) * CBG

Which after manipulation is:

A = (B - 0.1 * CBG) / 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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme