Skip to content

Instantly share code, notes, and snippets.

@litvil
Created June 23, 2015 10:23
Show Gist options
  • Save litvil/f9527584d0967e7beb48 to your computer and use it in GitHub Desktop.
Save litvil/f9527584d0967e7beb48 to your computer and use it in GitHub Desktop.
AdjustColor Hue Saturation Brightness Contrast of a MovieClip
import fl.motion.AdjustColor;
import flash.filters.ColorMatrixFilter;
var colorFilter:AdjustColor = new AdjustColor();
var mColorMatrix:ColorMatrixFilter;
var mMatrix:Array = [];
var MC:MovieClip = new MovieClip();
function adjustColors():void
{
//all 4 must contain a value of an integer, if one is not set, it will not work
colorFilter.hue = 50;
colorFilter.saturation = 50;
colorFilter.brightness = 50;
colorFilter.contrast = 0;
mMatrix = colorFilter.CalculateFinalFlatArray();
mColorMatrix = new ColorMatrixFilter(mMatrix);
MC.filters = [mColorMatrix];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment