MovieClip | +--com.robertpenner.display.ColorClip
The ColorClip class extends the MovieClip class adding a collection of utilities that allows for more intuitive color manipulation.
ActionScript 2.0; Flash Player 6
Property summary
Property | Description |
---|---|
rgb:Number |
The rgb property of the ColorClip. |
rgbStr:String |
The rgbStr property of the ColorClip. |
brightness:Number |
The brightness property of the ColorClip. |
brightOffset:Number |
The brightOffset property of the ColorClip. |
negativeColor:Number |
The negativeColor property of the ColorClip. |
red:Number |
The red property of the ColorClip. |
green:Number |
The green property of the ColorClip. |
blue:Number |
The blue property of the ColorClip. |
redPercent:Number |
The redPercent property of the ColorClip. |
greenPercent:Number |
The greenPercent property of the ColorClip. |
bluePercent:Number |
The bluePercent property of the ColorClip. |
redOffset:Number |
The redOffset property of the ColorClip. |
greenOffset:Number |
The greenOffset property of the ColorClip. |
blueOffset:Number |
The blueOffset property of the ColorClip. |
Method summary
Method | Description |
---|---|
init() : Void |
Decorates all MovieClips with the methods of the XColor class. |
mixin(obj:Object) : Void |
Decorates a particular MovieClip instance with the methods of the XColor class. |
setRGB(col:Number) : Void |
Specifies an RGB color for a ColorClip object. |
getRGB() : Number |
Returns the R+G+B combination currently in use by the ColorClip object. |
setRGBStr(hexStr:String) : Void |
Specifies an RGB color for a ColorClip object using a string hexadecimal value. |
getRGBStr() : String |
Returns the R+G+B combination currently in use by the ColorClip object as a string hexadecimal value. |
setRGB2(r:Number, g:Number, b:Number) : Void |
Specifies an RGB color for a ColorClip object using individual red, green, and blue values. |
getRGB2() : Object |
Returns the R+G+B values currently in use by the ColorClip object as individual red, green, and blue values. |
setColorTransform(trans:Object) : Void |
Sets color transform information for a ColorClip object. |
getColorTransform() : Object |
Returns the transform value set by the last color. |
resetColor() : Void |
Sets the color transform for a ColorClip object to its default values. |
setBrightness(bright:Number) : Void |
Specifies the brightness of a ColorClip object. |
getBrightness() : Number |
Returns the brightness of a ColorClip object. |
setBrightOffset(offset:Number) : Void |
Pushes a ColorClip object towards black or white by an absolute amount. |
getBrightOffset() : Number |
Returns the brightness offset value of a ColorClip object. |
setTint(r:Number, g:Number, b:Number, percent:Number) : Void |
Tints a ColorClip object with a color according to a certain percentage. |
getTint() : Object |
Returns the tint of a ColorClip object. |
setTint2(rgb:Number, percent:Number) : Void |
Tints a ColorClip object with a color according to a certain percentage. |
getTint2() : Object |
Returns the tint of a ColorClip object. |
setTintOffset(r:Number, g:Number, b:Number) : Void |
Tints a ColorClip object with a color according to red, green, and blue values. |
getTintOffset() : Object |
Returns the tint offset of a ColorClip object. |
setTintOffset2(rgb:Number) : Void |
Tints a ColorClip object with a color according to an rgb value. |
getTintOffset2() : Number |
Returns the tint offset of a ColorClip object. |
invertColor() : Void |
Performs a straightforward color inversion. |
setNegativeColor(percent:Number) : Void |
Inverts a ColorClip object by a certain percentage. |
getNegativeColor() : Number |
Returns the negative percentage of a ColorClip object. |
setRed(amount:Number) : Void |
Specifies a red color value for a ColorClip object. |
getRed() : Number |
Returns the red color value of a ColorClip object. |
setGreen(amount:Number) : Void |
Specifies a green color value for a ColorClip object. |
getGreen() : Number |
Returns the green color value of a ColorClip object. |
setBlue(amount:Number) : Void |
Specifies a blue color value for a ColorClip object. |
getBlue() : Number |
Returns the blue color value of a ColorClip object. |
setRedPercent(percent:Number) : Void |
Specifies a red percentage value for a ColorClip object. |
getRedPercent() : Number |
Returns the red percentage value of a ColorClip object. |
setGreenPercent(percent:Number) : Void |
Specifies a green percentage value for a ColorClip object. |
getGreenPercent() : Number |
Returns the green percentage value of a ColorClip object. |
setBluePercent(percent:Number) : Void |
Specifies a blue percentage value for a ColorClip object. |
getBluePercent() : Number |
Returns the blue percentage value of a ColorClip object. |
setRedOffset(offset:Number) : Void |
Specifies a red offset value for a ColorClip object. |
getRedOffset() : Number |
Returns the red offset value of a ColorClip object. |
setGreenOffset(offset:Number) : Void |
Specifies a green offset value for a ColorClip object. |
getGreenOffset() : Number |
Returns the green offset value of a ColorClip object. |
setBlueOffset(offset:Number) : Void |
Specifies a blue offset value for a ColorClip object. |
getBlueOffset() : Number |
Returns the blue offset value of a ColorClip object. |
com.robertpenner.display.ColorClip.init();
Nothing.
Decorates all MovieClips with the methods of the XColor class.
com.robertpenner.display.ColorClip.mixin(my_mc);
obj:Object
- The object to mix in.
Nothing.
Decorates a particular MovieClip instance with the methods of the XColor class.
my_mc.setRGB(0x0000FF);
col:Number
- The hexadecimal or RGB color to be set.
Nothing.
Specifies an RGB color for a ColorClip object.
trace (my_mc.getRGB());
A number that represents the RGB numeric value for the color specified.
Returns the R+G+B combination currently in use by the ColorClip object.
my_mc.setRGBStr("#FFFF00");
hexStr:String
- The string hexadecimal color to be set.
Nothing.
Specifies an RGB color for a ColorClip object using a string hexadecimal value.
trace (my_mc.getRGBStr());
The string hexadecimal color.
Returns the R+G+B combination currently in use by the ColorClip object as a string hexadecimal value.
my_mc.setRGB2(255, 0, 255);
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 ColorClip object using individual red, green, and blue values.
var rgb:Object = my_mc.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 ColorClip object as individual red, green, and blue values.
my_mc.setColorTransform({ ra: 50, rb: 244, ga: 25, gb: 112, ba: 75, bb: 90, aa: 40, ab: 70});
trans:Object
- The transform object to be set.
Nothing.
Sets color transform information for a ColorClip object.
var trans:Object = my_mc.getColorTransform();
trace (trans.ra);
trace (trans.ga);
trace (trans.ba);
An object whose properties contain the current offset and percentage values for the specified color.
Returns the transform value set by the last color.
my_mc.setRGB(0x0000FF);
my_mc.resetColor();
Nothing.
Sets the color transform for a ColorClip object to its default values.
my_mc.setBrightness(50);
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 ColorClip object.
my_mc.setBrightness(50);
trace (my_mc.getBrightness());
The brightness value.
Returns the brightness of a ColorClip object.
my_mc.setBrightOffset(140);
offset:Number
- A number between -255 and 255. Positive values push colors towards white; negative values towards black.
Nothing.
Pushes a ColorClip object towards black or white by an absolute amount.
my_mc.setBrightOffset(140);
trace (my_mc.getBrightOffset());
The brightness offset value.
Returns the brightness offset value of a ColorClip object.
my_mc.setTint(0, 0, 128, 50);
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 ColorClip object with a color according to a certain percentage.
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);
The tint value object with r, g, b, and percent properties.
Returns the tint of a ColorClip object.
my_mc.setTint2(0x0000FF, 100);
rgb:Number
- The rgb value.
percent:Number
- The tint percentage.
Nothing.
Tints a ColorClip object with a color according to a certain percentage.
my_mc.setTint2(0x0000FF, 100);
var tint:Object = my_mc.getTint2();
trace (tint.rgb);
trace (tint.percent);
The tint value object with rgb and percent properties.
Returns the tint of a ColorClip object.
my_mc.setTintOffset(0, 0, 128);
r:Number
- The red color value.
g:Number
- The green color value.
b:Number
- The blue color value.
Nothing.
Tints a ColorClip object with a color according to red, green, and blue values.
my_mc.setTintOffset(0, 0, 128);
var tint:Object = my_mc.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 a ColorClip object.
my_mc.setTintOffset2(0x000080);
rgb:Number
- The rgb value.
Nothing.
Tints a ColorClip object with a color according to an rgb value.
my_mc.setTintOffset2(0x000080);
trace (my_mc.getTintOffset2());
The tint offset value object with an rgb properties.
Returns the tint offset of a ColorClip object.
my_mc.invertColor();
Nothing.
Performs a straightforward color inversion.
my_mc.setNegativeColor(60);
percent:Number
- The negative percentage.
Nothing.
Inverts a ColorClip object by a certain percentage.
my_mc.setNegativeColor(60);
trace (my_mc.getNegativeColor());
The negative percentage.
Returns the negative percentage of a ColorClip object.
my_mc.setRed(128);
amount:Number
- The red color value.
Nothing.
Specifies a red color value for a ColorClip object.
my_mc.setRed(128);
trace (my_mc.getRed());
The red color value.
Returns the red color value of a ColorClip object.
my_mc.setGreen(128);
amount:Number
- The green color value.
Nothing.
Specifies a green color value for a ColorClip object.
my_mc.setGreen(128);
trace (my_mc.getGreen());
The green color value.
Returns the green color value of a ColorClip object.
my_mc.setBlue(128);
amount:Number
- The blue color value.
Nothing.
Specifies a blue color value for a ColorClip object.
my_mc.setBlue(128);
trace (my_mc.getBlue());
The blue color value.
Returns the blue color value of a ColorClip object.
my_mc.setRedPercent(50);
percent:Number
- The red percentage value.
Nothing.
Specifies a red percentage value for a ColorClip object.
my_mc.setRedPercent(50);
trace (my_mc.getRedPercent());
The red percentage value.
Returns the red percentage value of a ColorClip object.
my_mc.setGreenPercent(50);
percent:Number
- The green percentage value.
Nothing.
Specifies a green percentage value for a ColorClip object.
my_mc.setGreenPercent(50);
trace (my_mc.getGreenPercent());
The green percentage value.
Returns the green percentage value of a ColorClip object.
my_mc.setBluePercent(50);
percent:Number
- The blue percentage value.
Nothing.
Specifies a blue percentage value for a ColorClip object.
my_mc.setBluePercent(50);
trace (my_mc.getBluePercent());
The blue percentage value.
Returns the blue percentage value of a ColorClip object.
my_mc.setRedOffset(-128);
percent:
- The red offset value.
Nothing.
Specifies a red offset value for a ColorClip object.
my_mc.setRedOffset(-128);
trace (my_mc.getRedOffset());
The red offset value.
Returns the red offset value of a ColorClip object.
my_mc.setGreenOffset(-128);
percent:
- The green offset value.
Nothing.
Specifies a green offset value for a ColorClip object.
my_mc.setGreenOffset(-128);
trace (my_mc.getGreenOffset());
The green offset value.
Returns the green offset value of a ColorClip object.
my_mc.setBlueOffset(-128);
percent:
- The blue offset value.
Nothing.
Specifies a blue offset value for a ColorClip object.
my_mc.setBlueOffset(-128);
trace (my_mc.getBlueOffset());
The blue offset value.
Returns the blue offset value of a ColorClip object.
trace (my_mc.rgb);
The rgb property of the ColorClip.
trace (my_mc.rgbStr);
The rgbStr property of the ColorClip.
trace (my_mc.brightness);
The brightness property of the ColorClip.
trace (my_mc.brightOffset);
The brightOffset property of the ColorClip.
trace (my_mc.negativeColor);
The negativeColor property of the ColorClip.
trace (my_mc.red);
The red property of the ColorClip.
trace (my_mc.green);
The green property of the ColorClip.
trace (my_mc.blue);
The blue property of the ColorClip.
trace (my_mc.redPercent);
The redPercent property of the ColorClip.
trace (my_mc.greenPercent);
The greenPercent property of the ColorClip.
trace (my_mc.bluePercent);
The bluePercent property of the ColorClip.
trace (my_mc.redOffset);
The redOffset property of the ColorClip.
trace (my_mc.greenOffset);
The greenOffset property of the ColorClip.
trace (my_mc.blueOffset);
The blueOffset property of the ColorClip.