428
ActionScript classes
ColorTransform
(flash.geom.ColorTransform)
Object
|
+-flash.geom.ColorTransform
public class
ColorTransform
extends Object
The ColorTransform class lets you mathematically adjust all of the color values in a movie
clip. The color adjustment function or
color transformation
can be applied to all four channels:
red, green, blue, and alpha transparency.
When a ColorTransform object is applied to a movie clip, a new value for each color channel
is calculated like this:
■
New red value = (old red value *
redMultiplier)
+
redOffset
■
New green value = (old green value *
greenMultiplier)
+
greenOffset
■
New blue value = (old blue value *
blueMultiplier)
+
blueOffset
■
New alpha value = (old alpha value *
alphaMultiplier)
+
alphaOffset
If any of the color channel values is greater than 255 after the calculation, it is set to 255. If it
is less than 0, it is set to 0.
You must use the
new ColorTransform()
constructor to create a ColorTransform object
before you can call the methods of the ColorTransform object.
Color transformations do not apply to the background color of a movie clip (such as a loaded
SWF object). They apply only to graphics and symbols that are attached to the movie clip.
Availability:
ActionScript 1.0; Flash Player 8
See also
colorTransform (Transform.colorTransform property)
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...