| Package | graphics.colors |
| Class | public class ColorMatrix |
| Inheritance | ColorMatrix Object |
| Implements | Cloneable, Serializable |
| Property | Defined By | ||
|---|---|---|---|
| brightness : Number
Determinates the brightness component of the color matrix. | ColorMatrix | ||
| contrast : Number
Determinates the contrast component of the color matrix. | ColorMatrix | ||
| matrix : Array
The matrix representation of all color components values. | ColorMatrix | ||
| saturation : Number
Determinates the saturation component of the color matrix. | ColorMatrix | ||
| Method | Defined By | ||
|---|---|---|---|
ColorMatrix(factory:* = null)
Creates a new ColorMatrix instance. | ColorMatrix | ||
clone():*
Returns the shallow copy of the object. | ColorMatrix | ||
concat(mat:Array):Array
Concatenates the elements of a matrix specified in the parameter with the elements in an array and creates a new matrix
| ColorMatrix | ||
reset(init:Array = null):void
Reset and sets this colormatrix to identity:
[
1 , 0 , 0 , 0 , 0 ,
0 , 1 , 0 , 0 , 0 ,
0 , 0 , 1 , 0 , 0 ,
0 , 0 , 0 , 1 , 0
];
| ColorMatrix | ||
rotate(axis:int, degrees:Number):void
Sets the rotation on a color axis by the specified values. | ColorMatrix | ||
scale(r:Number, g:Number, b:Number, a:Number):void
Set this colormatrix to scale by the specified values. | ColorMatrix | ||
toSource(indent:int = 0):String
Returns the source code string representation of the object. | ColorMatrix | ||
toString():String
Returns the String representation of the object. | ColorMatrix | ||
| Constant | Defined By | ||
|---|---|---|---|
| B_AXIS : uint = 2 [static]
Defines the blue axis value in the rotate method (2). | ColorMatrix | ||
| G_AXIS : uint = 1 [static]
Defines the green axis value in the rotate method (1). | ColorMatrix | ||
| GRAYSCALE : Array [static]
The greyscale matrix representation to initialize the ColorMatrix. | ColorMatrix | ||
| IDENTITY : Array [static]
The identity matrix representation to initialize the ColorMatrix. | ColorMatrix | ||
| INVERT : Array [static]
The invert matrix representation to initialize the ColorMatrix. | ColorMatrix | ||
| R_AXIS : uint = 0 [static]
Defines the red axis value in the rotate method (0). | ColorMatrix | ||
| Constant | Defined By | ||
|---|---|---|---|
| RAD : Number = 0.017453292519943295 [static]
Value to convert a degree value in radian (Math.PI / 180). | ColorMatrix | ||
| brightness | property |
brightness:NumberDeterminates the brightness component of the color matrix.
public function get brightness():Number public function set brightness(value:Number):void| contrast | property |
contrast:NumberDeterminates the contrast component of the color matrix.
public function get contrast():Number public function set contrast(value:Number):void| matrix | property |
public var matrix:ArrayThe matrix representation of all color components values.
| saturation | property |
saturation:NumberDeterminates the saturation component of the color matrix. Info : The luminance vector where the red value is 0.3086, the green value is 0.6094, and the blue value is 0.0820. Notice here that we do not use the standard NTSC weights of 0.299, 0.587, and 0.114. The NTSC weights are only applicable to RGB colors in a gamma 2.2 color space. For linear RGB colors the values above are better.
public function get saturation():Number public function set saturation(value:Number):voidSee also
| ColorMatrix | () | Constructor |
public function ColorMatrix(factory:* = null)Creates a new ColorMatrix instance.
Parametersfactory:* (default = null) — The Array or ColorMatrix optional argument to initialize the new ColorMatrix instance.
If this argument is null the matrix is the identity 5x4 matrix.
|
| clone | () | method |
public function clone():*Returns the shallow copy of the object.
Returns* — the shallow copy of the object.
|
| concat | () | method |
public function concat(mat:Array):ArrayConcatenates the elements of a matrix specified in the parameter with the elements in an array and creates a new matrix
Parameters
mat:Array — The altered Matrix
|
Array |
| reset | () | method |
public function reset(init:Array = null):voidReset and sets this colormatrix to identity:
[
1 , 0 , 0 , 0 , 0 ,
0 , 1 , 0 , 0 , 0 ,
0 , 0 , 1 , 0 , 0 ,
0 , 0 , 0 , 1 , 0
];
Parameters
init:Array (default = null) |
| rotate | () | method |
public function rotate(axis:int, degrees:Number):voidSets the rotation on a color axis by the specified values.
Parameters
axis:int — The axis (red, green or blue axis) to rotate.
| |
degrees:Number — The angle in degree of the rotation.
|
ArgumentError — if the axis argument is not valid with the value 0, 1 or 2.
|
| scale | () | method |
public function scale(r:Number, g:Number, b:Number, a:Number):voidSet this colormatrix to scale by the specified values.
Parameters
r:Number — The scale value to change the red component of the color.
| |
g:Number — The scale value to change the green component of the color.
| |
b:Number — The scale value to change the blue component of the color.
| |
a:Number — The scale value to change the alpha component of the color.
|
| toSource | () | method |
public function toSource(indent:int = 0):StringReturns the source code string representation of the object.
Parameters
indent:int (default = 0) |
String — the source code string representation of the object.
|
| toString | () | method |
public function toString():StringReturns the String representation of the object.
ReturnsString — the String representation of the object.
|
| B_AXIS | Constant |
public static const B_AXIS:uint = 2Defines the blue axis value in the rotate method (2).
| G_AXIS | Constant |
public static const G_AXIS:uint = 1Defines the green axis value in the rotate method (1).
| GRAYSCALE | Constant |
public static const GRAYSCALE:ArrayThe greyscale matrix representation to initialize the ColorMatrix.
| IDENTITY | Constant |
public static const IDENTITY:ArrayThe identity matrix representation to initialize the ColorMatrix.
| INVERT | Constant |
public static const INVERT:ArrayThe invert matrix representation to initialize the ColorMatrix.
| R_AXIS | Constant |
public static const R_AXIS:uint = 0Defines the red axis value in the rotate method (0).
| RAD | Constant |
protected static const RAD:Number = 0.017453292519943295Value to convert a degree value in radian (Math.PI / 180).