This is for an Android application. Let's say that I have two colors with alpha
int color1 = 0x12345678 // aarrggbb
int color2 = 0x87654321
How do I compute the combined color of a layer with color2 over a layer with color1?
I found here a discussion and formula but checking here first if it is already available in Android and/or Java before writing my own code.
http://en.wikipedia.org/wiki/Alpha_compositing#Analytical_derivation_of_the_over_operator
Edit: please note that the goal of the question is not to end with a bitmap but a color (e.g. a aarrggbb int).