Created
June 23, 2015 10:23
-
-
Save litvil/f9527584d0967e7beb48 to your computer and use it in GitHub Desktop.
AdjustColor Hue Saturation Brightness Contrast of a MovieClip
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
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