javascript - Finding the Alpha given 3 colors -


for javascript program making, need find alpha value of overlay layer (#7f7f7f) on top of color (for example, #4a6cd4), had created output color (for example, #6380da). this:

from top bottom:
#7f7f7f (the alpha unknown)
#4a6cd4

which output #6380da. need know alpha value of overlay , how find it. can please me?

the "official" blending formula should be

resulting color = alpha * overlay color + (1 - alpha) * background color

the equation has calculated each channel (red, green , blue, each represented 2 digits of color code in hexadecimal representation)

you can solve alpha (or use excel , solve numerically)

the formula not match example values have given, though - actual values or random example?


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -