ColorTransformClip (com.robertpenner.display.ColorTransformClip)

MovieClip
        |
        +--com.robertpenner.display.ColorTransformClip
class ColorTransformClip
extends MovieClip

The ColorTransformClip class extends the MovieClip class adding a collection of utilities that allows for more intuitive color manipulation.

Availability:

ActionScript 2.0; Flash Player 8

Property summary

Property Description
rgb:Number

The rgb property of the ColorTransformClip.

rgbStr:String

The rgbStr property of the ColorTransformClip.

brightness:Number

The brightness property of the ColorTransformClip.

brightOffset:Number

The brightOffset property of the ColorTransformClip.

negativeColor:Number

The negativeColor property of the ColorTransformClip.

red:Number

The red property of the ColorTransformClip.

green:Number

The green property of the ColorTransformClip.

blue:Number

The blue property of the ColorTransformClip.

redPercent:Number

The redPercent property of the ColorTransformClip.

greenPercent:Number

The greenPercent property of the ColorTransformClip.

bluePercent:Number

The bluePercent property of the ColorTransformClip.

redOffset:Number

The redOffset property of the ColorTransformClip.

greenOffset:Number

The greenOffset property of the ColorTransformClip.

blueOffset:Number

The blueOffset property of the ColorTransformClip.

alphaOffset:Number

The alphaOffset property of the ColorTransformClip.

redMultiplier:Number

The redMultiplier property of the ColorTransformClip.

greenMultiplier:Number

The greenMultiplier property of the ColorTransformClip.

blueMultiplier:Number

The blueMultiplier property of the ColorTransformClip.

alphaMultiplier:Number

The alphaMultiplier property of the ColorTransformClip.

Method summary

Method Description
init() : Void

Decorates all MovieClips with the methods of the XColorTransform class.

mixin(obj:Object) : Void

Decorates a particular MovieClip instance with the methods of the XColorTransform class.

setRGB(col:Number) : Void

Specifies an RGB color for a ColorTransformClip object.

getRGB() : Number

Returns the R+G+B combination currently in use by the ColorTransformClip object.

setRGBStr(hexStr:String) : Void

Specifies an RGB color for a ColorTransformClip object using a string hexadecimal value.

getRGBStr() : String

Returns the R+G+B combination currently in use by the ColorTransformClip object as a string hexadecimal value.

setRGB2(r:Number, g:Number, b:Number) : Void

Specifies an RGB color for a ColorTransformClip object using individual red, green, and blue values.

getRGB2() : Object

Returns the R+G+B values currently in use by the ColorTransformClip object as individual red, green, and blue values.

resetColor() : Void

Sets the color transform for a ColorTransformClip object to its default values.

setBrightness(bright:Number) : Void

Specifies the brightness of a ColorTransformClip object.

getBrightness() : Number

Returns the brightness of a ColorTransformClip object.

setBrightOffset(offset:Number) : Void

Pushes a ColorTransformClip object towards black or white by an absolute amount.

getBrightOffset() : Number

Returns the brightness offset value of a ColorTransformClip object.

setTint(r:Number, g:Number, b:Number, percent:Number) : Void

Tints a ColorTransformClip object with a color according to a certain percentage.

getTint() : Object

Returns the tint of a ColorTransformClip object.

setTint2(rgb:Number, percent:Number) : Void

Tints a ColorTransformClip object with a color according to a certain percentage.

getTint2() : Object

Returns the tint of a ColorTransformClip object.

setTintOffset(r:Number, g:Number, b:Number) : Void

Tints a ColorTransformClip object with a color according to red, green, and blue values.

getTintOffset() : Object

Returns the tint offset of a ColorTransformClip object.

setTintOffset2(rgb:Number) : Void

Tints a ColorTransformClip object with a color according to an rgb value.

getTintOffset2() : Number

Returns the tint offset of a ColorTransformClip object.

invertColor() : Void

Performs a straightforward color inversion.

setNegativeColor(percent:Number) : Void

Inverts a ColorTransformClip object by a certain percentage.

getNegativeColor() : Number

Returns the negative percentage of a ColorTransformClip object.

setRed(amount:Number) : Void

Specifies a red color value for a ColorTransformClip object.

getRed() : Number

Returns the red color value of a ColorTransformClip object.

setGreen(amount:Number) : Void

Specifies a green color value for a ColorTransformClip object.

getGreen() : Number

Returns the green color value of a ColorTransformClip object.

setBlue(amount:Number) : Void

Specifies a blue color value for a ColorTransformClip object.

getBlue() : Number

Returns the blue color value of a ColorTransformClip object.

setRedPercent(percent:Number) : Void

Specifies a red percentage value for a ColorTransformClip object.

getRedPercent() : Number

Returns the red percentage value of a ColorTransformClip object.

setGreenPercent(percent:Number) : Void

Specifies a green percentage value for a ColorTransformClip object.

getGreenPercent() : Number

Returns the green percentage value of a ColorTransformClip object.

setBluePercent(percent:Number) : Void

Specifies a blue percentage value for a ColorTransformClip object.

getBluePercent() : Number

Returns the blue percentage value of a ColorTransformClip object.

setRedOffset(offset:Number) : Void

Specifies a red offset value for a ColorTransformClip object.

getRedOffset() : Number

Returns the red offset value of a ColorTransformClip object.

setGreenOffset(offset:Number) : Void

Specifies a green offset value for a ColorTransformClip object.

getGreenOffset() : Number

Returns the green offset value of a ColorTransformClip object.

setBlueOffset(offset:Number) : Void

Specifies a blue offset value for a ColorTransformClip object.

getBlueOffset() : Number

Returns the blue offset value of a ColorTransformClip object.

setAlphaOffset(offset:Number) : Void

Specifies an alpha offset value for a ColorTransformClip object.

getAlphaOffset() : Number

Returns the alpha offset value of a ColorTransformClip object.

setRedMultiplier(multiplier:Number) : Void

Specifies a red multiplier value for a ColorTransformClip object.

getRedMultiplier() : Number

Returns the red multiplier value of a ColorTransformClip object.

setGreenMultiplier(multiplier:Number) : Void

Specifies a green multiplier value for a ColorTransformClip object.

getGreenMultiplier() : Number

Returns the green multiplier value of a ColorTransformClip object.

setBlueMultiplier(multiplier:Number) : Void

Specifies a blue multiplier value for a ColorTransformClip object.

getBlueMultiplier() : Number

Returns the blue multiplier value of a ColorTransformClip object.

setAlphaMultiplier(multiplier:Number) : Void

Specifies an alpha multiplier value for a ColorTransformClip object.

getAlphaMultiplier() : Number

Returns the alpha multiplier value of a ColorTransformClip object.

colorToString() : String

Formats and returns a string that describes all of the color properties of the ColorTransformClip object.

init() : Void

Usage


com.robertpenner.display.ColorTransformClip.init();

Parameters

Returns

Nothing.

Description

Decorates all MovieClips with the methods of the XColorTransform class.


mixin(obj:Object) : Void

Usage


com.robertpenner.display.ColorTransformClip.mixin(my_mc);

Parameters

obj:Object - The object to mix in.

Returns

Nothing.

Description

Decorates a particular MovieClip instance with the methods of the XColorTransform class.


setRGB(col:Number) : Void

Usage


my_mc.setRGB(0x0000FF);

Parameters

col:Number - The hexadecimal or RGB color to be set.

Returns

Nothing.

Description

Specifies an RGB color for a ColorTransformClip object.


getRGB() : Number

Usage


trace (my_mc.getRGB());

Parameters

Returns

A number that represents the RGB numeric value for the color specified.

Description

Returns the R+G+B combination currently in use by the ColorTransformClip object.


setRGBStr(hexStr:String) : Void

Usage


my_mc.setRGBStr("#FFFF00");

Parameters

hexStr:String - The string hexadecimal color to be set.

Returns

Nothing.

Description

Specifies an RGB color for a ColorTransformClip object using a string hexadecimal value.


getRGBStr() : String

Usage


trace (my_mc.getRGBStr());

Parameters

Returns

The string hexadecimal color.

Description

Returns the R+G+B combination currently in use by the ColorTransformClip object as a string hexadecimal value.


setRGB2(r:Number, g:Number, b:Number) : Void

Usage


my_mc.setRGB2(255, 0, 255);

Parameters

r:Number - The red color value.

g:Number - The green color value.

b:Number - The blue color value.

Returns

Nothing.

Description

Specifies an RGB color for a ColorTransformClip object using individual red, green, and blue values.


getRGB2() : Object

Usage


var rgb:Object = my_mc.getRGB2();
trace (rgb.r);
trace (rgb.g);
trace (rgb.b);

Parameters

Returns

The RBG value object with r, g, and b properties.

Description

Returns the R+G+B values currently in use by the ColorTransformClip object as individual red, green, and blue values.


resetColor() : Void

Usage


my_mc.rgb = 0x0000FF;
my_mc.resetColor();

Parameters

Returns

Nothing.

Description

Sets the color transform for a ColorTransformClip object to its default values.


setBrightness(bright:Number) : Void

Usage


my_mc.setBrightness(50);

Parameters

bright:Number - A percentage value between -100 and 100. Positive values brighten the color. and negative values darken it.

Returns

Nothing.

Description

Specifies the brightness of a ColorTransformClip object.


getBrightness() : Number

Usage


my_mc.setBrightness(50);
trace (my_mc.getBrightness());

Parameters

Returns

The brightness value.

Description

Returns the brightness of a ColorTransformClip object.


setBrightOffset(offset:Number) : Void

Usage


my_mc.setBrightOffset(140);

Parameters

offset:Number - A number between -255 and 255. Positive values push colors towards white; negative values towards black.

Returns

Nothing.

Description

Pushes a ColorTransformClip object towards black or white by an absolute amount.


getBrightOffset() : Number

Usage


my_mc.setBrightOffset(140);
trace (my_mc.getBrightOffset());

Parameters

Returns

The brightness offset value.

Description

Returns the brightness offset value of a ColorTransformClip object.


setTint(r:Number, g:Number, b:Number, percent:Number) : Void

Usage


my_mc.setTint(0, 0, 128, 50);

Parameters

r:Number - The red color value.

g:Number - The green color value.

b:Number - The blue color value.

percent:Number - The tint percentage.

Returns

Nothing.

Description

Tints a ColorTransformClip object with a color according to a certain percentage.


getTint() : Object

Usage


my_mc.setTint(0, 0, 128, 50);
var tint:Object = my_mc.getTint();
trace (tint.r);
trace (tint.g);
trace (tint.b);
trace (tint.percent);

Parameters

Returns

The tint value object with r, g, b, and percent properties.

Description

Returns the tint of a ColorTransformClip object.


setTint2(rgb:Number, percent:Number) : Void

Usage


my_mc.setTint2(0x0000FF, 100);

Parameters

rgb:Number - The rgb value.

percent:Number - The tint percentage.

Returns

Nothing.

Description

Tints a ColorTransformClip object with a color according to a certain percentage.


getTint2() : Object

Usage


my_mc.setTint2(0x0000FF, 100);
var tint:Object = my_mc.getTint2();
trace (tint.rgb);
trace (tint.percent);

Parameters

Returns

The tint value object with rgb and percent properties.

Description

Returns the tint of a ColorTransformClip object.


setTintOffset(r:Number, g:Number, b:Number) : Void

Usage


my_mc.setTintOffset(0, 0, 128);

Parameters

r:Number - The red color value.

g:Number - The green color value.

b:Number - The blue color value.

Returns

Nothing.

Description

Tints a ColorTransformClip object with a color according to red, green, and blue values.


getTintOffset() : Object

Usage


my_mc.setTintOffset(0, 0, 128);
var tint:Object = my_mc.getTintOffset();
trace (tint.r);
trace (tint.g);
trace (tint.b);

Parameters

Returns

The tint offset value object with r, g, and b properties.

Description

Returns the tint offset of a ColorTransformClip object.


setTintOffset2(rgb:Number) : Void

Usage


my_mc.setTintOffset2(0x000080);

Parameters

rgb:Number - The rgb value.

Returns

Nothing.

Description

Tints a ColorTransformClip object with a color according to an rgb value.


getTintOffset2() : Number

Usage


my_mc.setTintOffset2(0x000080);
trace (my_mc.getTintOffset2());

Parameters

Returns

The tint offset value object with an rgb properties.

Description

Returns the tint offset of a ColorTransformClip object.


invertColor() : Void

Usage


my_mc.invertColor();

Parameters

Returns

Nothing.

Description

Performs a straightforward color inversion.


setNegativeColor(percent:Number) : Void

Usage


my_mc.setNegativeColor(60);

Parameters

percent:Number - The negative percentage.

Returns

Nothing.

Description

Inverts a ColorTransformClip object by a certain percentage.


getNegativeColor() : Number

Usage


my_mc.setNegativeColor(60);
trace (my_mc.getNegativeColor());

Parameters

Returns

The negative percentage.

Description

Returns the negative percentage of a ColorTransformClip object.


setRed(amount:Number) : Void

Usage


my_mc.setRed(128);

Parameters

amount:Number - The red color value.

Returns

Nothing.

Description

Specifies a red color value for a ColorTransformClip object.


getRed() : Number

Usage


my_mc.setRed(128);
trace (my_mc.getRed());

Parameters

Returns

The red color value.

Description

Returns the red color value of a ColorTransformClip object.


setGreen(amount:Number) : Void

Usage


my_mc.setGreen(128);

Parameters

amount:Number - The green color value.

Returns

Nothing.

Description

Specifies a green color value for a ColorTransformClip object.


getGreen() : Number

Usage


my_mc.setGreen(128);
trace (my_mc.getGreen());

Parameters

Returns

The green color value.

Description

Returns the green color value of a ColorTransformClip object.


setBlue(amount:Number) : Void

Usage


my_mc.setBlue(128);

Parameters

amount:Number - The blue color value.

Returns

Nothing.

Description

Specifies a blue color value for a ColorTransformClip object.


getBlue() : Number

Usage


my_mc.setBlue(128);
trace (my_mc.getBlue());

Parameters

Returns

The blue color value.

Description

Returns the blue color value of a ColorTransformClip object.


setRedPercent(percent:Number) : Void

Usage


my_mc.setRedPercent(50);

Parameters

percent:Number - The red percentage value.

Returns

Nothing.

Description

Specifies a red percentage value for a ColorTransformClip object.


getRedPercent() : Number

Usage


my_mc.setRedPercent(50);
trace (my_mc.getRedPercent());

Parameters

Returns

The red percentage value.

Description

Returns the red percentage value of a ColorTransformClip object.


setGreenPercent(percent:Number) : Void

Usage


my_mc.setGreenPercent(50);

Parameters

percent:Number - The green percentage value.

Returns

Nothing.

Description

Specifies a green percentage value for a ColorTransformClip object.


getGreenPercent() : Number

Usage


my_mc.setGreenPercent(50);
trace (my_mc.getGreenPercent());

Parameters

Returns

The green percentage value.

Description

Returns the green percentage value of a ColorTransformClip object.


setBluePercent(percent:Number) : Void

Usage


my_mc.setBluePercent(50);

Parameters

percent:Number - The blue percentage value.

Returns

Nothing.

Description

Specifies a blue percentage value for a ColorTransformClip object.


getBluePercent() : Number

Usage


my_mc.setBluePercent(50);
trace (my_mc.getBluePercent());

Parameters

Returns

The blue percentage value.

Description

Returns the blue percentage value of a ColorTransformClip object.


setRedOffset(offset:Number) : Void

Usage


my_mc.setRedOffset(-128);

Parameters

offset:Number - The red offset value.

Returns

Nothing.

Description

Specifies a red offset value for a ColorTransformClip object.


getRedOffset() : Number

Usage


my_mc.setRedOffset(-128);
trace (my_mc.getRedOffset());

Parameters

Returns

The red offset value.

Description

Returns the red offset value of a ColorTransformClip object.


setGreenOffset(offset:Number) : Void

Usage


my_mc.setGreenOffset(-128);

Parameters

offset:Number - The green offset value.

Returns

Nothing.

Description

Specifies a green offset value for a ColorTransformClip object.


getGreenOffset() : Number

Usage


my_mc.setGreenOffset(-128);
trace (my_mc.getGreenOffset());

Parameters

Returns

The green offset value.

Description

Returns the green offset value of a ColorTransformClip object.


setBlueOffset(offset:Number) : Void

Usage


my_mc.setBlueOffset(-128);

Parameters

offset:Number - The blue offset value.

Returns

Nothing.

Description

Specifies a blue offset value for a ColorTransformClip object.


getBlueOffset() : Number

Usage


my_mc.setBlueOffset(-128);
trace (my_mc.getBlueOffset());

Parameters

Returns

The blue offset value.

Description

Returns the blue offset value of a ColorTransformClip object.


setAlphaOffset(offset:Number) : Void

Usage


my_mc.setAlphaOffset(-128);

Parameters

offset:Number - The alpha offset value.

Returns

Nothing.

Description

Specifies an alpha offset value for a ColorTransformClip object.


getAlphaOffset() : Number

Usage


my_mc.setAlphaOffset(-128);
trace (my_mc.getAlphaOffset());

Parameters

Returns

The alpha offset value.

Description

Returns the alpha offset value of a ColorTransformClip object.


setRedMultiplier(multiplier:Number) : Void

Usage


my_mc.setRedMultiplier(.5);

Parameters

multiplier:Number - The red multiplier value.

Returns

Nothing.

Description

Specifies a red multiplier value for a ColorTransformClip object.


getRedMultiplier() : Number

Usage


my_mc.setRedMultiplier(.5);
trace (my_mc.getRedMultiplier());

Parameters

Returns

The red multiplier value.

Description

Returns the red multiplier value of a ColorTransformClip object.


setGreenMultiplier(multiplier:Number) : Void

Usage


my_mc.setGreenMultiplier(.5);

Parameters

multiplier:Number - The green multiplier value.

Returns

Nothing.

Description

Specifies a green multiplier value for a ColorTransformClip object.


getGreenMultiplier() : Number

Usage


my_mc.setGreenMultiplier(.5);
trace (my_mc.getGreenMultiplier());

Parameters

Returns

The green multiplier value.

Description

Returns the green multiplier value of a ColorTransformClip object.


setBlueMultiplier(multiplier:Number) : Void

Usage


my_mc.setBlueMultiplier(.5);

Parameters

multiplier:Number - The blue multiplier value.

Returns

Nothing.

Description

Specifies a blue multiplier value for a ColorTransformClip object.


getBlueMultiplier() : Number

Usage


my_mc.setBlueMultiplier(.5);
trace (my_mc.getBlueMultiplier());

Parameters

Returns

The blue multiplier value.

Description

Returns the blue multiplier value of a ColorTransformClip object.


setAlphaMultiplier(multiplier:Number) : Void

Usage


my_mc.setAlphaMultiplier(.5);

Parameters

multiplier:Number - The alpha multiplier value.

Returns

Nothing.

Description

Specifies an alpha multiplier value for a ColorTransformClip object.


getAlphaMultiplier() : Number

Usage


my_mc.setAlphaMultiplier(.5);
trace (my_mc.getAlphaMultiplier());

Parameters

Returns

The alpha multiplier value.

Description

Returns the alpha multiplier value of a ColorTransformClip object.


colorToString() : String

Usage


trace(my_mc.colorToString());

Parameters

Returns

A string that lists all of the color properties of the ColorTransformClip object.

Description

Formats and returns a string that describes all of the color properties of the ColorTransformClip object.


rgb : Number

Usage


trace (my_mc.rgb);

Description

The rgb property of the ColorTransformClip.


rgbStr : String

Usage


trace (my_mc.rgbStr);

Description

The rgbStr property of the ColorTransformClip.


brightness : Number

Usage


trace (my_mc.brightness);

Description

The brightness property of the ColorTransformClip.


brightOffset : Number

Usage


trace (my_mc.brightOffset);

Description

The brightOffset property of the ColorTransformClip.


negativeColor : Number

Usage


trace (my_mc.negativeColor);

Description

The negativeColor property of the ColorTransformClip.


red : Number

Usage


trace (my_mc.red);

Description

The red property of the ColorTransformClip.


green : Number

Usage


trace (my_mc.green);

Description

The green property of the ColorTransformClip.


blue : Number

Usage


trace (my_mc.blue);

Description

The blue property of the ColorTransformClip.


redPercent : Number

Usage


trace (my_mc.redPercent);

Description

The redPercent property of the ColorTransformClip.


greenPercent : Number

Usage


trace (my_mc.greenPercent);

Description

The greenPercent property of the ColorTransformClip.


bluePercent : Number

Usage


trace (my_mc.bluePercent);

Description

The bluePercent property of the ColorTransformClip.


redOffset : Number

Usage


trace (my_mc.redOffset);

Description

The redOffset property of the ColorTransformClip.


greenOffset : Number

Usage


trace (my_mc.greenOffset);

Description

The greenOffset property of the ColorTransformClip.


blueOffset : Number

Usage


trace (my_mc.blueOffset);

Description

The blueOffset property of the ColorTransformClip.


alphaOffset : Number

Usage


trace (my_mc.alphaOffset);

Description

The alphaOffset property of the ColorTransformClip.


redMultiplier : Number

Usage


trace (my_mc.redMultiplier);

Description

The redMultiplier property of the ColorTransformClip.


greenMultiplier : Number

Usage


trace (my_mc.greenMultiplier);

Description

The greenMultiplier property of the ColorTransformClip.


blueMultiplier : Number

Usage


trace (my_mc.blueMultiplier);

Description

The blueMultiplier property of the ColorTransformClip.


alphaMultiplier : Number

Usage


trace (my_mc.alphaMultiplier);

Description

The alphaMultiplier property of the ColorTransformClip.