Package | fl.motion |
Class | public class Color |
Inheritance | Color ColorTransform Object |
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS3 |
Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
Related API Elements
Property | Defined By | ||
---|---|---|---|
alphaMultiplier : Number
A decimal value that is multiplied with the alpha transparency channel value. | ColorTransform | ||
alphaOffset : Number
A number from -255 to 255 that is added to the alpha transparency channel value after it has
been multiplied by the alphaMultiplier value. | ColorTransform | ||
blueMultiplier : Number
A decimal value that is multiplied with the blue channel value. | ColorTransform | ||
blueOffset : Number
A number from -255 to 255 that is added to the blue channel value after it has
been multiplied by the blueMultiplier value. | ColorTransform | ||
brightness : Number
The percentage of brightness, as a decimal between -1 and 1. | Color | ||
color : uint
The RGB color value for a ColorTransform object. | ColorTransform | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
greenMultiplier : Number
A decimal value that is multiplied with the green channel value. | ColorTransform | ||
greenOffset : Number
A number from -255 to 255 that is added to the green channel value after it has
been multiplied by the greenMultiplier value. | ColorTransform | ||
prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | ||
redMultiplier : Number
A decimal value that is multiplied with the red channel value. | ColorTransform | ||
redOffset : Number
A number from -255 to 255 that is added to the red channel value after it has been
multiplied by the redMultiplier value. | ColorTransform | ||
tintColor : uint
The tinting color value in the 0xRRGGBB format. | Color | ||
tintMultiplier : Number
The percentage to apply the tint color, as a decimal value between 0 and 1. | Color |
Method | Defined By | ||
---|---|---|---|
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)
Constructor for Color instances. | Color | ||
Concatenates the ColorTranform object specified by the second parameter
with the current ColorTransform object and sets the
current object as the result, which is an additive combination of the two color transformations. | ColorTransform | ||
[static]
Creates a Color instance from XML. | Color | ||
Indicates whether an object has a specified property defined. | Object | ||
[static]
Blends smoothly from one color value to another. | Color | ||
interpolateTransform(fromColor:flash.geom:ColorTransform, toColor:flash.geom:ColorTransform, progress:Number):flash.geom:ColorTransform [static]
Blends smoothly from one ColorTransform object to another. | Color | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Sets the tint color and amount at the same time. | Color | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Formats and returns a string that describes all of the properties of the
ColorTransform object. | ColorTransform | ||
Returns the primitive value of the specified object. | Object |
brightness | property |
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):void
tintColor | property |
tintColor: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):void
tintMultiplier | property |
tintMultiplier: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):void
Color | () | Constructor |
public 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.
ParametersredMultiplier: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.
|
fromXML | () | method |
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.
|
Color — A Color instance that matches the XML description.
|
interpolateColor | () | method |
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.
|
uint — The interpolated color value, in the 0xRRGGBB or 0xAARRGGBB format.
|
interpolateTransform | () | method |
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
fromColor:flash.geom:ColorTransform — The starting ColorTransform object.
| |
toColor:flash.geom:ColorTransform — The ending ColorTransform object.
| |
progress:Number — The percent of the transition as a decimal, where 0 is the start and 1 is the end.
|
flash.geom:ColorTransform — The interpolated ColorTransform object.
|
setTint | () | method |
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.
|
import fl.transitions.Tween; import fl.transitions.TweenEvent; import fl.transitions.easing.Strong; import fl.motion.Color; import flash.events.Event; import flash.geom.ColorTransform; var start_color:Color = new Color(); start_color.setTint(0xFF0000, 0.5); var final_color:uint=0x006699; var clip_mc:MovieClip=new MovieClip(); clip_mc.graphics.beginFill(start_color,1); clip_mc.graphics.drawRect(200,200,200,200); clip_mc.graphics.endFill(); addChild(clip_mc); var colorInfo:ColorTransform=clip_mc.transform.colorTransform; function initTween(event:MouseEvent):void { var my_tween:Tween=new Tween(clip_mc,'alpha',Strong.easeOut,0,1,1,true); my_tween.addEventListener(TweenEvent.MOTION_CHANGE,tweenToFinal); } function tweenToFinal(event:TweenEvent):void { colorInfo.color=Color.interpolateColor(start_color,final_color,event.position); clip_mc.transform.colorTransform=colorInfo; } stage.addEventListener(MouseEvent.CLICK,initTween);
Mon Nov 28 2011, 06:48 AM -08:00