I\'m writing a colour picker that gets the pixel RGB values from wherever you point to on the screen. I want to also have the option of specifying that the colour I picked
The following pseudo-code resolves your problem:
CalculateSolidColorFromTransparentColor(Color color, Color background)
{
alpha = color.A / 255;
oneminusalpha = 1 - alpha;
newR = ((color.R * alpha) + (oneminusalpha * background.R));
newG = ((color.G * alpha) + (oneminusalpha * background.G));
newB = ((color.B * alpha) + (oneminusalpha * background.B));
}
Note that input color and backgroud has values expressed in [0..255]