| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
The Color class extends the Flash Player ColorTransform class,
adding the ability to control brightness and tint.
It also contains static methods for interpolating between two ColorTransform objects
or between two color numbers.
brightness:Number| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
The percentage of brightness, as a decimal between -1 and 1.
Positive values lighten the object, and a value of 1 turns the object completely white.
Negative values darken the object, and a value of -1 turns the object completely black.
The default value is 0.
Implementation public function get brightness():Number public function set brightness(value:Number):voidtintColor:uint| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
The tinting color value in the 0xRRGGBB format.
The default value is 0x000000 (black).
Implementation public function get tintColor():uint public function set tintColor(value:uint):voidtintMultiplier:Number| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
The percentage to apply the tint color, as a decimal value between 0 and 1.
When tintMultiplier = 0, the target object is its original color and no tint color is visible.
When tintMultiplier = 1, the target object is completely tinted and none of its original color is visible.
The default value is 0.
Implementation public function get tintMultiplier():Number public function set tintMultiplier(value:Number):voidpublic function Color(redMultiplier:Number = 1.0, greenMultiplier:Number = 1.0, blueMultiplier:Number = 1.0, alphaMultiplier:Number = 1.0, redOffset:Number = 0, greenOffset:Number = 0, blueOffset:Number = 0, alphaOffset:Number = 0)| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
Constructor for Color instances.
Parameters | redMultiplier:Number (default = 1.0) — The percentage to apply the color, as a decimal value between 0 and 1.
|
| |
| greenMultiplier:Number (default = 1.0) — The percentage to apply the color, as a decimal value between 0 and 1.
|
| |
| blueMultiplier:Number (default = 1.0) — The percentage to apply the color, as a decimal value between 0 and 1.
|
| |
| alphaMultiplier:Number (default = 1.0) — A decimal value that is multiplied with the alpha transparency channel value, as a decimal value between 0 and 1.
|
| |
| redOffset:Number (default = 0) — A number from -255 to 255 that is added to the red channel value after it has been multiplied by the redMultiplier value.
|
| |
| greenOffset:Number (default = 0) — A number from -255 to 255 that is added to the green channel value after it has been multiplied by the greenMultiplier value.
|
| |
| blueOffset:Number (default = 0) — A number from -255 to 255 that is added to the blue channel value after it has been multiplied by the blueMultiplier value.
|
| |
| alphaOffset:Number (default = 0) — A number from -255 to 255 that is added to the alpha channel value after it has been multiplied by the alphaMultiplier value.
|
public static function fromXML(xml:XML):Color| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
Creates a Color instance from XML.
Parameters
| xml:XML — An E4X XML object containing a <color> node from Motion XML.
|
Returns | Color — A Color instance that matches the XML description.
|
public static function interpolateColor(fromColor:uint, toColor:uint, progress:Number):uint| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
Blends smoothly from one color value to another.
Parameters
| fromColor:uint — The starting color value, in the 0xRRGGBB or 0xAARRGGBB format.
|
| |
| toColor:uint — The ending color value, in the 0xRRGGBB or 0xAARRGGBB format.
|
| |
| progress:Number — The percent of the transition as a decimal, where 0 is the start and 1 is the end.
|
Returns | uint — The interpolated color value, in the 0xRRGGBB or 0xAARRGGBB format.
|
public static function interpolateTransform(fromColor:flash.geom:ColorTransform, toColor:flash.geom:ColorTransform, progress:Number):flash.geom:ColorTransform| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
Blends smoothly from one ColorTransform object to another.
Parameters
Returns public function setTint(tintColor:uint, tintMultiplier:Number):void| Language Version: | ActionScript 3.0 |
| Product Version: | Flash CS3 |
| Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
Sets the tint color and amount at the same time.
Parameters
| tintColor:uint — The tinting color value in the 0xRRGGBB format.
|
| |
| tintMultiplier:Number — The percentage to apply the tint color, as a decimal value between 0 and 1.
When tintMultiplier = 0, the target object is its original color and no tint color is visible.
When tintMultiplier = 1, the target object is completely tinted and none of its original color is visible.
|
© 2009 Adobe Systems Incorporated. All rights reserved.
Wed May 6 2009, 01:04 AM -07:00