Created
September 30, 2013 22:26
-
-
Save jlewin/6771228 to your computer and use it in GitHub Desktop.
Over operator for linear interpolation of color values given a source, destination and alpha
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Over Operator | |
| // color = As * Cs + (1 - As) * Cd | |
| function over( sourceColor, destColor, alpha ) { | |
| return alpha * sourceColor + ( 1 - alpha ) * destColor; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment