Well, the answer will be based only on knowledge of the background color. Something like this will work if backgroundColorand sourceColorare UIColors:
float blend(float src, float srcAlpha, float background) {
return (background + src * srcAlpha) / 2;
}
UIColor *result = [UIColor colorWithRed:blend([sourceColor red], [sourceColor alpha], [backgroundColor red])
green:blend([sourceColor green], [sourceColor alpha], [backgroundColor green])
blue:blend([sourceColor blue], [sourceColor alpha], [backgroundColor blue])
alpha:1.0f];
, , . , . blend, , , , , .