Name

Color.getTransform( ) Method — retrieve both the current offset and percentage values for a clip’s Red, Green, Blue, and Alpha components

Availability

Flash 5

Synopsis

colorObj.getTransform( )

Returns

An object whose properties contain the color transformation values for the target clip of colorObj.

Description

The getTransform( ) method returns an object with properties that tell us which transformations are currently applied to the target of a Color object. The property names and values of the returned object are described in Table 20.4.

Table 20-4. Properties of Object Returned by getTransform( )

Property Name

Property Value

Property Description

ra

-100 to 100

The Red transformation percentage

rb

-255 to 255

The Red offset amount

ga

-100 to 100

The Green transformation percentage

gb

-255 to 255

The Green offset amount

ba

-100 to 100

The Blue transformation percentage

bb

-255 to 255

The Blue offset amount

aa

-100 to 100

The Alpha transformation percentage

ab

-255 to 255

The Alpha offset amount

Usage

Note in Table 20.4 that both the percentage and the offset can have negative values; however, these are only one factor in calculating the RGB color components, which always range from 0 to 255. Values outside that range are clipped to the allowable range. See the Color class description for an explanation of the calculation used to determine final RGB and Alpha color components.

Example

We can use getTransform( ) in combination with setTransform( ) to modify ...

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.