ColorMatrix is a 4x5 matrix containing color multiplication and offset values for tinting and other kinds of color manipulation. In addition to using the multiplier, offset and color properties, it can be edited directly as a Float32Array

Static variables

staticalphaMultiplier:Float

The current alpha multiplication value (default is 1.0)

staticalphaOffset:Float

The current alpha offset value (default is 0)

staticblueMultiplier:Float

The current blue multiplication value (default is 1.0)

staticblueOffset:Float

The current blue offset value (default is 0)

staticcolor:Int

Gets or sets a color offset for tinting.

This will change the red, green and blue multipliers to zero, and affect the red, green and blue offset values.

staticgreenMultiplier:Float

The current green multiplication value (default is 1.0)

staticgreenOffset:Float

The current green offset value (default is 0)

staticredMultiplier:Float

The current red multiplication value (default is 1.0)

staticredOffset:Float

The current red offset value (default is 0)

Static methods

staticclone(this:Float32Array):ColorMatrix

Creates a duplicate of the current ColorMatrix instance

Returns:

A new ColorMatrix instance

staticconcat(this:Float32Array, second:ColorMatrix):Void

Adds the color multipliers from a second ColorMatrix to the current one

Parameters:

second

The ColorMatrix to concat to the current one

staticcopyFrom(this:Float32Array, other:ColorMatrix):Void

Sets the current ColorMatrix values to the same as another one

Parameters:

other

The ColorMatrix to copy from

staticgetAlphaTable(this:Float32Array):UInt8Array

Returns a reference to a UInt8Array table for transforming alpha values using the current matrix.

The table is 256 values in length, and includes values based on the alphaMultipler and alphaOffset values of the matrix.

The values are constrained within 0 and 255.

For example:

var colorMatrix = new ColorMatrix ();
colorMatrix.alphaOffset = 12;

var alphaTable = colorMatrix.getAlphaTable ();
trace (alphaTable[0]); // 12
trace (alphaTable[1]); // 13

staticgetBlueTable(this:Float32Array):UInt8Array

Returns a reference to a UInt8Array table for transforming blue values using the current matrix.

The table is 256 values in length, and includes values based on the blueMultiplier and blueOffset values of the matrix.

The values are constrained within 0 and 255.

For example:

var colorMatrix = new ColorMatrix ();
colorMatrix.blueOffset = 16;

var blueTable = colorMatrix.getBlueTable ();
trace (blueTable[0]); // 16
trace (blueTable[1]); // 17

staticgetGreenTable(this:Float32Array):UInt8Array

Returns a reference to a UInt8Array table for transforming green values using the current matrix.

The table is 256 values in length, and includes values based on the greenMultiplier and greenOffset values of the matrix.

The values are constrained within 0 and 255.

For example:

var colorMatrix = new ColorMatrix ();
colorMatrix.greenOffset = 16;

var greenTable = colorMatrix.getGreenTable ();
trace (greenTable[0]); // 16
trace (greenTable[1]); // 17

staticgetRedTable(this:Float32Array):UInt8Array

Returns a reference to a UInt8Array table for transforming red values using the current matrix.

The table is 256 values in length, and includes values based on the redMultiplier and redOffset values of the matrix.

The values are constrained within 0 and 255.

For example:

var colorMatrix = new ColorMatrix ();
colorMatrix.redOffset = 16;

var redTable = colorMatrix.getRedTable ();
trace (redTable[0]); // 16
trace (redTable[1]); // 17

staticidentity(this:Float32Array):Void

Resets to default values