Skip to content

Instantly share code, notes, and snippets.

@hyzhak
Created March 27, 2010 23:44
Show Gist options
  • Select an option

  • Save hyzhak/346429 to your computer and use it in GitHub Desktop.

Select an option

Save hyzhak/346429 to your computer and use it in GitHub Desktop.
private var rc:Number = 1/3, gc:Number = 1/3, bc:Number = 1/3;
private var sf:ColorMatrixFilter = new ColorMatrixFilter([rc, gc, bc, 0, 0, rc, gc, bc, 0, 0, rc, gc, bc, 0, 0, 0, 0, 0, 1, 0]);
private function blackAndWhite(target:UIComponent, enabled:Boolean):void
{
if(enabled) target.filters = [sf];
else target.filters = [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment