Skip to content →

Blending RGB Colors

http://stackoverflow.com/questions/726549/algorithm-for-additive-color-mixing-for-rgb-values

 

Implementation in Objective C:

 

-(float)blendChannel:(float)ch1 withChannel:(float)ch2 blendPoint:(float)blendPoint{
return sqrt((1-blendPoint)*pow(ch1, 2) + blendPoint * pow(ch2, 2));
}
-(float)blendAlpha:(float)ch1 withChannel:(float)ch2 blendPoint:(float)blendPoint{
return (1-blendPoint)*ch1 + blendPoint*ch2;
}

 

Published in Uncategorized

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *