ColorTransform | +--com.robertpenner.graphics.XColorTransform
The XColorTransform class extends the ColorTransform class adding a collection of utilities that allows for more intuitive color manipulation.
ActionScript 2.0; Flash Player 8
Property summary
Property | Description |
---|---|
rgb:Number |
The rgb property of the XColorTransform object. |
redOffset:Number |
The redOffset property of the XColorTransform object. |
greenOffset:Number |
The greenOffset property of the XColorTransform object. |
blueOffset:Number |
The blueOffset property of the XColorTransform object. |
alphaOffset:Number |
The alphaOffset property of the XColorTransform object. |
redMultiplier:Number |
The redMultiplier property of the XColorTransform object. |
greenMultiplier:Number |
The greenMultiplier property of the XColorTransform object. |
blueMultiplier:Number |
The blueMultiplier property of the XColorTransform object. |
alphaMultiplier:Number |
The alphaMultiplier property of the XColorTransform object. |
rgbStr:String |
The rgbStr property of the XColorTransform object. |
brightness:Number |
The brightness property of the XColorTransform object. |
brightOffset:Number |
The brightOffset property of the XColorTransform object. |
negative:Number |
The negative property of the XColorTransform object. |
red:Number |
The red property of the XColorTransform object. |
green:Number |
The green property of the XColorTransform object. |
blue:Number |
The blue property of the XColorTransform object. |
redPercent:Number |
The redPercent property of the XColorTransform object. |
greenPercent:Number |
The greenPercent property of the XColorTransform object. |
bluePercent:Number |
The bluePercent property of the XColorTransform object. |
Method summary
Method | Description |
---|---|
setRGBStr(hexStr:String) : Void |
Specifies an RGB color for an XColorTransform object using a string hexadecimal value. |
getRGBStr() : String |
Returns the R+G+B combination currently in use by the XColorTransform object as a string hexadecimal value. |
setRGB2(r:Number, g:Number, b:Number) : Void |
Specifies an RGB color for an XColorTransform object using individual red, green, and blue values. |
getRGB2() : Object |
Returns the R+G+B values currently in use by the XColorTransform object as individual red, green, and blue values. |
reset() : Void |
Sets the color transform for an XColorTransform object to its default values. |
setBrightness(bright:Number) : Void |
Specifies the brightness of an XColorTransform object. |
getBrightness() : Number |
Returns the brightness of an XColorTransform object. |
setBrightOffset(offset:Number) : Void |
Pushes an XColorTransform object towards black or white by an absolute amount. |
getBrightOffset() : Number |
Returns the brightness offset value of an XColorTransform object. |
setTint(r:Number, g:Number, b:Number, percent:Number) : Void |
Tints an XColorTransform object with a color according to a certain percentage. |
getTint() : Object |
Returns the tint of an XColorTransform object. |
setTint2(rgb:Number, percent:Number) : Void |
Tints an XColorTransform object with a color according to a certain percentage. |
getTint2() : Object |
Returns the tint of an XColorTransform object. |
setTintOffset(r:Number, g:Number, b:Number) : Void |
Tints an XColorTransform object with a color according to red, green, and blue values. |
getTintOffset() : Object |
Returns the tint offset of an XColorTransform object. |
setTintOffset2(rgb:Number) : Void |
Tints an XColorTransform object with a color according to an rgb value. |
getTintOffset2() : Number |
Returns the tint offset of an XColorTransform object. |
invert() : Void |
Performs a straightforward color inversion. |
setNegative(percent:Number) : Void |
Inverts an XColorTransform object by a certain percentage. |
getNegative() : Number |
Returns the negative percentage of an XColorTransform object. |
setRed(amount:Number) : Void |
Specifies a red color value for an XColorTransform object. |
getRed() : Number |
Returns the red color value of an XColorTransform object. |
setGreen(amount:Number) : Void |
Specifies a green color value for an XColorTransform object. |
getGreen() : Number |
Returns the green color value of an XColorTransform object. |
setBlue(amount:Number) : Void |
Specifies a blue color value for an XColorTransform object. |
getBlue() : Number |
Returns the blue color value of an XColorTransform object. |
setRedPercent(percent:Number) : Void |
Specifies a red percentage value for an XColorTransform object. |
getRedPercent() : Number |
Returns the red percentage value of an XColorTransform object. |
setGreenPercent(percent:Number) : Void |
Specifies a green percentage value for an XColorTransform object. |
getGreenPercent() : Number |
Returns the green percentage value of an XColorTransform object. |
setBluePercent(percent:Number) : Void |
Specifies a blue percentage value for an XColorTransform object. |
getBluePercent() : Number |
Returns the blue percentage value of an XColorTransform object. |
toString() : String |
Formats and returns a string that describes all of the properties of the XColorTransform object. |
concat(second:ColorTransform) : Void |
Applies a second, additive color transformation to the movie clip. |
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRGBStr("#FFFF00");
my_trans.colorTransform = my_colorTrans;
hexStr:String
- The string hexadecimal color to be set.
Nothing.
Specifies an RGB color for an XColorTransform object using a string hexadecimal value.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
trace (my_colorTrans.getRGBStr());
The string hexadecimal color.
Returns the R+G+B combination currently in use by the XColorTransform object as a string hexadecimal value.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRGB2(255, 0, 255);
my_trans.colorTransform = my_colorTrans;
r:Number
- The red color value.
g:Number
- The green color value.
b:Number
- The blue color value.
Nothing.
Specifies an RGB color for an XColorTransform object using individual red, green, and blue values.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRGB2(255, 0, 255);
my_trans.colorTransform = my_colorTrans;
var rgb:Object = my_colorTrans.getRGB2();
trace (rgb.r);
trace (rgb.g);
trace (rgb.b);
The RBG value object with r, g, and b properties.
Returns the R+G+B values currently in use by the XColorTransform object as individual red, green, and blue values.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.rgb = 0x0000FF;
my_trans.colorTransform = my_colorTrans;
my_colorTrans.reset();
my_trans.colorTransform = my_colorTrans;
Nothing.
Sets the color transform for an XColorTransform object to its default values.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBrightness(50);
my_trans.colorTransform = my_colorTrans;
bright:Number
- A percentage value between -100 and 100. Positive values brighten the color. and negative values darken it.
Nothing.
Specifies the brightness of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBrightness(50);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getBrightness());
The brightness value.
Returns the brightness of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBrightOffset(140);
my_trans.colorTransform = my_colorTrans;
offset:Number
- A number between -255 and 255. Positive values push colors towards white; negative values towards black.
Nothing.
Pushes an XColorTransform object towards black or white by an absolute amount.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBrightOffset(140);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getBrightOffset());
The brightness offset value.
Returns the brightness offset value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTint(0, 0, 128, 50);
my_trans.colorTransform = my_colorTrans;
r:Number
- The red color value.
g:Number
- The green color value.
b:Number
- The blue color value.
percent:Number
- The tint percentage.
Nothing.
Tints an XColorTransform object with a color according to a certain percentage.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTint(0, 0, 128, 50);
my_trans.colorTransform = my_colorTrans;
var tint:Object = my_colorTrans.getTint();
trace (tint.r);
trace (tint.g);
trace (tint.b);
trace (tint.percent);
The tint value object with r, g, b, and percent properties.
Returns the tint of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTint2(0x0000FF, 100);
my_trans.colorTransform = my_colorTrans;
rgb:Number
- The rgb value.
percent:Number
- The tint percentage.
Nothing.
Tints an XColorTransform object with a color according to a certain percentage.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTint2(0x0000FF, 100);
my_trans.colorTransform = my_colorTrans;
var tint:Object = my_colorTrans.getTint2();
trace (tint.rgb);
trace (tint.percent);
The tint value object with rgb and percent properties.
Returns the tint of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTintOffset(0, 0, 128);
my_trans.colorTransform = my_colorTrans;
r:Number
- The red color value.
g:Number
- The green color value.
b:Number
- The blue color value.
Nothing.
Tints an XColorTransform object with a color according to red, green, and blue values.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTintOffset(0, 0, 128);
my_trans.colorTransform = my_colorTrans;
var tint:Object = my_colorTrans.getTintOffset();
trace (tint.r);
trace (tint.g);
trace (tint.b);
The tint offset value object with r, g, and b properties.
Returns the tint offset of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTintOffset2(0x000080);
my_trans.colorTransform = my_colorTrans;
rgb:Number
- The rgb value.
Nothing.
Tints an XColorTransform object with a color according to an rgb value.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setTintOffset2(0x000080);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getTintOffset2());
The tint offset value object with an rgb properties.
Returns the tint offset of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.invert();
my_trans.colorTransform = my_colorTrans;
Nothing.
Performs a straightforward color inversion.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setNegative(60);
my_trans.colorTransform = my_colorTrans;
percent:Number
- The negative percentage.
Nothing.
Inverts an XColorTransform object by a certain percentage.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setNegative(60);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getNegative());
The negative percentage.
Returns the negative percentage of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRed(128);
my_trans.colorTransform = my_colorTrans;
amount:Number
- The red color value.
Nothing.
Specifies a red color value for an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRed(128);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getRed());
The red color value.
Returns the red color value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setGreen(128);
my_trans.colorTransform = my_colorTrans;
amount:Number
- The green color value.
Nothing.
Specifies a green color value for an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setGreen(128);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getGreen());
The green color value.
Returns the green color value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBlue(128);
my_trans.colorTransform = my_colorTrans;
amount:Number
- The blue color value.
Nothing.
Specifies a blue color value for an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBlue(128);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getBlue());
The blue color value.
Returns the blue color value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRedPercent(50);
my_trans.colorTransform = my_colorTrans;
percent:Number
- The red percentage value.
Nothing.
Specifies a red percentage value for an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setRedPercent(50);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getRedPercent());
The red percentage value.
Returns the red percentage value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setGreenPercent(50);
my_trans.colorTransform = my_colorTrans;
percent:Number
- The green percentage value.
Nothing.
Specifies a green percentage value for an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setGreenPercent(50);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getGreenPercent());
The green percentage value.
Returns the green percentage value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBluePercent(50);
my_trans.colorTransform = my_colorTrans;
percent:Number
- The blue percentage value.
Nothing.
Specifies a blue percentage value for an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.setBluePercent(50);
my_trans.colorTransform = my_colorTrans;
trace (my_colorTrans.getBluePercent());
The blue percentage value.
Returns the blue percentage value of an XColorTransform object.
var my_colorTrans:XColorTransform = new XColorTransform(1, 2, 3, 4, -255, -128, 128, 255);
trace(my_colorTrans.toString());
A string that lists all of the properties of the XColorTransform object.
Formats and returns a string that describes all of the properties of the XColorTransform object.
var colorTrans_1:XColorTransform = new XColorTransform(1, 1, 1, 1, 255, 0, 0, 0);
var colorTrans_2:XColorTransform = new XColorTransform(1, 1, 1, .5, 0, 0, 0, 0);
colorTrans_1.concat(colorTrans_2);
var my_trans:Transform = new Transform(my_mc);
my_trans.colorTransform = colorTrans_1;
second:ColorTransform
- A second ColorTransform object to be combined with the current XColorTransform object.
Nothing.
Applies a second, additive color transformation to the movie clip.
trace (my_colorTrans.rgb);
The rgb property of the XColorTransform object.
trace (my_colorTrans.redOffset);
The redOffset property of the XColorTransform object.
trace (my_colorTrans.greenOffset);
The greenOffset property of the XColorTransform object.
trace (my_colorTrans.blueOffset);
The blueOffset property of the XColorTransform object.
trace (my_colorTrans.alphaOffset);
The alphaOffset property of the XColorTransform object.
trace (my_colorTrans.redMultiplier);
The redMultiplier property of the XColorTransform object.
trace (my_colorTrans.greenMultiplier);
The greenMultiplier property of the XColorTransform object.
trace (my_colorTrans.blueMultiplier);
The blueMultiplier property of the XColorTransform object.
trace (my_colorTrans.alphaMultiplier);
The alphaMultiplier property of the XColorTransform object.
trace (my_colorTrans.rgbStr);
The rgbStr property of the XColorTransform object.
trace (my_colorTrans.brightness);
The brightness property of the XColorTransform object.
trace (my_colorTrans.brightOffset);
The brightOffset property of the XColorTransform object.
trace (my_colorTrans.negative);
The negative property of the XColorTransform object.
trace (my_colorTrans.red);
The red property of the XColorTransform object.
trace (my_colorTrans.green);
The green property of the XColorTransform object.
trace (my_colorTrans.blue);
The blue property of the XColorTransform object.
trace (my_colorTrans.redPercent);
The redPercent property of the XColorTransform object.
trace (my_colorTrans.greenPercent);
The greenPercent property of the XColorTransform object.
trace (my_colorTrans.bluePercent);
The bluePercent property of the XColorTransform object.