ColorTransform

Description

The ColorTransform class lets you transform or modify the color of your display object by adjusting the color values. You can modify all the four channels: red, green, blue, and alpha transparency.

The ColorTransform class contains eight members, which are the offsets and multipliers for each of the four color channels. When a ColorTransform object is applied to a display object, a new value for each color channel is calculated as follows:

  • 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

Syntax

new flwebgl.geom.ColorTransform(alphaOffset, alphaMultiplier, redOffset, redMultiplier, greenOffset, greenMultiplier, blueOffset, blueMultiplier)

Parameters

Name

Type

Description

alphaOffset

number

(optional) Range -255 to 255, Default = 0

alphaMultiplier

number

(optional) Range -1 to 1, Default = 1

redOffset

number

(optional) Range -255 to 255 Default = 0

redMultiplier

number

(optional) Range -1 to 1, Default = 1

greenOffset

number

(optional) Range -255 to 255, Default = 0

greenMultiplier

number

(optional) Range -1 to 1, Default = 1

blueOffset

number

(optional) Range -255 to 255, Default = 0

blueMultiplier

number

(optional) Range -1 to 1, Default = 1

Methods

clone()

Description

    This method returns a clone of the ColorTransform instance

Returns

  • A clone of the ColorTransform instance
  • Type - ColorTransform

concat(colorTx)

Description

Use this method to concatenate the supplied ColorTransform with the current ColorTransform, effectively combining the effects of the two.

Parameters

Name

Type

Description

colorTx

The Color transform to multiply

Returns

  • This ColorTransform. You can use this method to chain method calls.
  • Type - ColorTransform

copy(colorTransform)

Description

 Use this method to copy the specified ColorTransform to this ColorTransform.

Parameters

Name

Type

Description

colorTransform

The ColorTransform instance to copy properties from

Returns

  • This ColorTransform. You can use this method to chain method calls.
  • Type - ColorTransform

equals(colorTx)

Description

Use this method to check if the passed ColorTransform has the same values as this instance.

Parameters

Name

Type

Description

colorTx

The Color transform to compare

Returns

  • Type - boolean

getAlphaMultiplier()

Description

    This method returns the alpha multiplier.

Returns

  • Type - number

getAlphaOffset()

Description

    This method returns the alpha offset.

Returns

  • Type - number

getBlueMultiplier()

Description

    This method returns the blue multiplier.

Returns

  • Type - number

getBlueOffset()

Description

    This method returns the blue offset.

Returns

  • Type - number

getGreenMultiplier()

Description

    This method returns the green multiplier.

Returns:

  • Type - number

getGreenOffset()

Description

    This method returns the green offset.

Returns

  • Type - Number

getRedMultiplier()

Description

    This method returns the red multiplier.

Returns

  • Type - number

getRedOffset()

Description

    This method returns the red offset.

Returns

  • Type - number

identity()

Description

    This method sets the Color transform to an Identity Color transform.

Returns

  • This Color Transform. You can use this method to chain method calls.
  • Type - ColorTransform

isIdentity()

Description

    This method indicates 'true' if the Color transform is an identity Color transform.

Returns

  • Type - boolean

setAlphaMultiplier(Multiplier)

Description

Use this method to set the alpha multiplier.

Parameters

Name

Type

Description

Multiplier

number

A value that is multiplied with the alpha transparency channel value

setAlphaOffset(offset)

Description

 Use this method to set the alpha offset.

Parameters

Name

Type

Description

offset

number

A number that is added to the alpha transparency channel value after it has been multiplied by the alphaMultiplier value

setBlueMultiplier(multiplier)

Description

Use this method to set the blue multiplier.

Parameters

Name

Type

Description

multiplier

number

A value that is multiplied with the blue channel value

setBlueOffset(offset)

Description

Use this method to set the blue offset

Parameters

Name

Type

Description

offset

number

A number that is added to the blue channel value after it has been multiplied by the blueMultiplier value

setGreenMultiplier(multiplier)

Description

Use this method to set the green multiplier.

Parameters

Name

Type

Description

multiplier

number

A value that is multiplied with the green channel value

setGreenOffset(offset)

Description

Use this method to set the green offset

Parameters

Name

Type

Description

offset

number

A number that is added to the green channel value after it has been multiplied by the greenMultiplier value

setRedMultiplier(multiplier)

Description

Use this method to set the red multiplier.

Parameters

Name

Type

Description

multiplier

number

A value that is multiplied with the red channel value

setRedOffset(offset)

Description

Use this method to set the red offset.

Parameters

Name

Type

Description

offset

number

A number that is added to the red channel value after it has been multiplied by the redMultiplier value

Adobe logo

Sign in to your account