Skip to content

Instantly share code, notes, and snippets.

@jlewin
Created September 30, 2013 22:26
Show Gist options
  • Select an option

  • Save jlewin/6771228 to your computer and use it in GitHub Desktop.

Select an option

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
// 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