Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Created February 20, 2010 04:17
Show Gist options
  • Save ongaeshi/309498 to your computer and use it in GitHub Desktop.
Save ongaeshi/309498 to your computer and use it in GitHub Desktop.
private function colorMul(color:uint, rate:Number):uint
{
var r:uint = (color >> 16) & 0xff;
var g:uint = (color >> 8) & 0xff;
var b:uint = (color >> 0) & 0xff;
r *= rate;
g *= rate;
b *= rate;
return ((r & 0xff) << 16) | ((g & 0xff) << 6) | (b & 0xff);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment