Color

Color class

Represents an ARGB (alpha, red, green, blue) color.

Constructors

NameDescription
constructor()Default Constructor.
constructor(number, number, number)Constructs a Color object from the specified 8-bit color values (red, green, and blue).
constructor(number, number, number, number)Constructs a Color object from the four ARGB component (alpha, red, green, and blue) values.

Properties

NameDescription
aGets or sets the alpha component value of this Color class.
rGets or sets the red component value of this Color class.
gGets or sets the green component value of this Color class.
bGets or sets the blue component value of this Color class.

Methods

MethodDescription
equals(Color)Determines whether the specified color is equal to the current color.

constructor()

Default Constructor.

constructor();

constructor(number, number, number)

Constructs a Color object from the specified 8-bit color values (red, green, and blue).

constructor(r: number, g: number, b: number);

Parameters:

ParameterTypeDescription
rnumberThe red component value(0~255).
gnumberThe green component value(0~255).
bnumberThe blue component value(0~255).

constructor(number, number, number, number)

Constructs a Color object from the four ARGB component (alpha, red, green, and blue) values.

constructor(a: number, r: number, g: number, b: number);

Parameters:

ParameterTypeDescription
anumberThe alpha component value(0~255).
rnumberThe red component value(0~255).
gnumberThe green component value(0~255).
bnumberThe blue component value(0~255).

equals(Color)

Determines whether the specified color is equal to the current color.

equals(color: Color): boolean;

Parameters:

ParameterTypeDescription
colorColorAn color to compare with this color.

Returns

true if the current color is equal to other; otherwise, false.