The ColorTransformUtil class includes a collection of utilities that allows for more intuitive color manipulation.
ActionScript 2.0; Flash Player 8
Method summary
Method | Description |
---|---|
setRGBStr(colorTrans:ColorTransform, hexStr:String) : Void |
Specifies an RGB color for a ColorTransform object using a string hexadecimal value. |
getRGBStr(colorTrans:ColorTransform) : String |
Returns the R+G+B combination currently in use by the ColorTransform object as a string hexadecimal value. |
setRGB2(colorTrans:ColorTransform, r:Number, g:Number, b:Number) : Void |
Specifies an RGB color for a ColorTransform object using individual red, green, and blue values. |
getRGB2(colorTrans:ColorTransform) : Object |
Returns the R+G+B values currently in use by the ColorTransform object as individual red, green, and blue values. |
reset(colorTrans:ColorTransform) : Void |
Resets a ColorTransform object to its default values. |
setBrightness(colorTrans:ColorTransform, bright:Number) : Void |
Specifies the brightness of a ColorTransform object. |
getBrightness(colorTrans:ColorTransform) : Number |
Returns the brightness of a ColorTransform object. |
setBrightOffset(colorTrans:ColorTransform, offset:Number) : Void |
Pushes a ColorTransform object towards black or white by an absolute amount. |
getBrightOffset(colorTrans:ColorTransform) : Number |
Returns the brightness offset value of a ColorTransform object. |
setTint(colorTrans:ColorTransform, r:Number, g:Number, b:Number, percent:Number) : Void |
Tints a ColorTransform object with a color according to a certain percentage. |
getTint(colorTrans:ColorTransform) : Object |
Returns the tint of a ColorTransform object. |
setTint2(colorTrans:ColorTransform, rgb:Number, percent:Number) : Void |
Tints a ColorTransform object with a color according to a certain percentage. |
getTint2(colorTrans:ColorTransform) : Object |
Returns the tint of a ColorTransform object. |
setTintOffset(colorTrans:ColorTransform, r:Number, g:Number, b:Number) : Void |
Tints a ColorTransform object with a color according to red, green, and blue values. |
getTintOffset(colorTrans:ColorTransform) : Object |
Returns the tint offset of a ColorTransform object. |
setTintOffset2(colorTrans:ColorTransform, rgb:Number) : Void |
Tints a ColorTransform object with a color according to an rgb value. |
getTintOffset2(colorTrans:ColorTransform) : Number |
Returns the tint offset of a ColorTransform object. |
invert(colorTrans:ColorTransform) : Void |
Performs a straightforward color inversion. |
setNegative(colorTrans:ColorTransform, percent:Number) : Void |
Inverts a ColorTransform object by a certain percentage. |
getNegative(colorTrans:ColorTransform) : Number |
Returns the negative percentage of a ColorTransform object. |
setRed(colorTrans:ColorTransform, amount:Number) : Void |
Specifies a red color value for a ColorTransform object. |
getRed(colorTrans:ColorTransform) : Number |
Returns the red color value of a ColorTransform object. |
setGreen(colorTrans:ColorTransform, amount:Number) : Void |
Specifies a green color value for a ColorTransform object. |
getGreen(colorTrans:ColorTransform) : Number |
Returns the green color value of a ColorTransform object. |
setBlue(colorTrans:ColorTransform, amount:Number) : Void |
Specifies a blue color value for a ColorTransform object. |
getBlue(colorTrans:ColorTransform) : Number |
Returns the blue color value of a ColorTransform object. |
setRedPercent(colorTrans:ColorTransform, percent:Number) : Void |
Specifies a red percentage value for a ColorTransform object. |
getRedPercent(colorTrans:ColorTransform) : Number |
Returns the red percentage value of a ColorTransform object. |
setGreenPercent(colorTrans:ColorTransform, percent:Number) : Void |
Specifies a green percentage value for a ColorTransform object. |
getGreenPercent(colorTrans:ColorTransform) : Number |
Returns the green percentage value of a ColorTransform object. |
setBluePercent(colorTrans:ColorTransform, percent:Number) : Void |
Specifies a blue percentage value for a ColorTransform object. |
getBluePercent(colorTrans:ColorTransform) : Number |
Returns the blue percentage value of a ColorTransform object. |
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setRGBStr(my_colorTrans, "#FFFF00");
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
hexStr:String
- The string hexadecimal color to be set.
Nothing.
Specifies an RGB color for a ColorTransform object using a string hexadecimal value.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.rgb = 0x0000FF;
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getRGBStr(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The string hexadecimal color.
Returns the R+G+B combination currently in use by the ColorTransform object as a string hexadecimal value.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setRGB2(my_colorTrans, 255, 0, 255);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
r:Number
- The red color value.
g:Number
- The green color value.
b:Number
- The blue color value.
Nothing.
Specifies an RGB color for a ColorTransform object using individual red, green, and blue values.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
var rgb:Object = ColorTransformUtil.getRGB2(my_colorTrans);
trace (rgb.r);
trace (rgb.g);
trace (rgb.b);
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The RBG value object with r, g, and b properties.
Returns the R+G+B values currently in use by the ColorTransform object as individual red, green, and blue values.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
my_colorTrans.rgb = 0x0000FF;
my_trans.colorTransform = my_colorTrans;
ColorTransformUtil.reset(my_colorTrans);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
Nothing.
Resets a ColorTransform object to its default values.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBrightness(my_colorTrans, -50);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
bright:Number
- A percentage value between -100 and 100. Positive values brighten the color. and negative values darken it.
Nothing.
Specifies the brightness of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBrightness(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getBrightness(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The brightness value.
Returns the brightness of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBrightOffset(my_colorTrans, 140);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
offset:Number
- A number between -255 and 255. Positive values push colors towards white; negative values towards black.
Nothing.
Pushes a ColorTransform object towards black or white by an absolute amount.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBrightOffset(my_colorTrans, 140);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getBrightOffset(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The brightness offset value.
Returns the brightness offset value of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTint(my_colorTrans, 0, 0, 128, 50);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
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 a ColorTransform object with a color according to a certain percentage.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTint(my_colorTrans, 0, 0, 128, 50);
my_trans.colorTransform = my_colorTrans;
var tint:Object = ColorTransformUtil.getTint(my_colorTrans);
trace (tint.r);
trace (tint.g);
trace (tint.b);
trace (tint.percent);
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The tint value object with r, g, b, and percent properties.
Returns the tint of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTint2(my_colorTrans, 0x0000FF, 100);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
rgb:Number
- The rgb value.
percent:Number
- The tint percentage.
Nothing.
Tints a ColorTransform object with a color according to a certain percentage.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTint2(my_colorTrans, 0x0000FF, 100);
my_trans.colorTransform = my_colorTrans;
var tint:Object = ColorTransformUtil.getTint2(my_colorTrans);
trace (tint.rgb);
trace (tint.percent);
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The tint value object with rgb and percent properties.
Returns the tint of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTintOffset(my_colorTrans, 0, 0, 128);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
r:Number
- The red color value.
g:Number
- The green color value.
b:Number
- The blue color value.
Nothing.
Tints a ColorTransform object with a color according to red, green, and blue values.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTintOffset(my_colorTrans, 0, 0, 128);
my_trans.colorTransform = my_colorTrans;
var tint:Object = ColorTransformUtil.getTintOffset(my_colorTrans);
trace (tint.r);
trace (tint.g);
trace (tint.b);
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The tint offset value object with r, g, and b properties.
Returns the tint offset of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTintOffset2(my_colorTrans, 0x000080);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
rgb:Number
- The rgb value.
Nothing.
Tints a ColorTransform object with a color according to an rgb value.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setTintOffset2(my_colorTrans, 0x000080);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getTintOffset2(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The tint offset value object with an rgb properties.
Returns the tint offset of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.invert(my_colorTrans);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
Nothing.
Performs a straightforward color inversion.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setNegative(my_colorTrans, 60);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
percent:Number
- The negative percentage.
Nothing.
Inverts a ColorTransform object by a certain percentage.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setNegative(my_colorTrans, 60);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getNegative(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The negative percentage.
Returns the negative percentage of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setRed(my_colorTrans, 128);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
amount:Number
- The red color value.
Nothing.
Specifies a red color value for a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setRed(my_colorTrans, 128);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getRed(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The red color value.
Returns the red color value of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setGreen(my_colorTrans, 128);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
amount:Number
- The green color value.
Nothing.
Specifies a green color value for a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setGreen(my_colorTrans, 128);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getGreen(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The green color value.
Returns the green color value of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBlue(my_colorTrans, 128);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
amount:Number
- The blue color value.
Nothing.
Specifies a blue color value for a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBlue(my_colorTrans, 128);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getBlue(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The blue color value.
Returns the blue color value of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setRedPercent(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
percent:Number
- The red percentage value.
Nothing.
Specifies a red percentage value for a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setRedPercent(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getRedPercent(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The red percentage value.
Returns the red percentage value of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setGreenPercent(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
percent:Number
- The green percentage value.
Nothing.
Specifies a green percentage value for a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setGreenPercent(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getGreenPercent(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The green percentage value.
Returns the green percentage value of a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBluePercent(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
colorTrans:ColorTransform
- The ColorTransform object to manipulate.
percent:Number
- The blue percentage value.
Nothing.
Specifies a blue percentage value for a ColorTransform object.
var my_colorTrans:ColorTransform = new ColorTransform();
var my_trans:Transform = new Transform(my_mc);
ColorTransformUtil.setBluePercent(my_colorTrans, 50);
my_trans.colorTransform = my_colorTrans;
trace (ColorTransformUtil.getBluePercent(my_colorTrans));
colorTrans:ColorTransform
- The ColorTransform object from which to retrieve the value.
The blue percentage value.
Returns the blue percentage value of a ColorTransform object.