Skip to content
Henryk Wollik edited this page Jul 28, 2014 · 1 revision

Class: Color

Color

new Color(r, g, b, a)

Represents color information in rgba format.

Parameters:
Name Type Argument Default Description
r Number <optional>
0

Red value (floating point data)

g Number <optional>
0

Green value (floating point data)

b Number <optional>
0

Blue value (floating point data)

a Number <optional>
1

Alpha value (floating point data)

Source:

Members

a :Number

Alpha value (floating point data)

Type:
  • Number
Source:

b :Number

Blue value (floating point data)

Type:
  • Number
Source:

g :Number

Green value (floating point data)

Type:
  • Number
Source:

r :Number

Red value (floating point data)

Type:
  • Number
Source:

Methods

<static> black() → {Color}

Create a new color with r=0,g=0,b=0,a=1

Source:
Returns:
Type
Color

<static> blue() → {Color}

Create a new color with r=0,g=0,b=1,a=1

Source:
Returns:
Type
Color

<static> green() → {Color}

Create a new color with r=0,g=1,b=0,a=1

Source:
Returns:
Type
Color

<static> red() → {Color}

Create a new color with r=1,g=0,b=0,a=1

Source:
Returns:
Type
Color

<static> white() → {Color}

Create a new color with r=1,g=1,b=1,a=1

Source:
Returns:
Type
Color

copy(color) → {Color}

Returns a copy of the color

Parameters:
Name Type Argument Description
color Color <optional>

The out color

Source:
Returns:
Type
Color

equals(color) → {boolean}

Check if color equals another color.

Parameters:
Name Type Description
color Color

Another color

Source:
Returns:
Type
boolean

set(color) → {Color}

Set from another color.

Parameters:
Name Type Description
color Color

Another color

Source:
Returns:
Type
Color

setf(r, g, b, a) → {Color}

Set rgba components.

Parameters:
Name Type Argument Default Description
r Number <optional>
0

Red value (floating point data)

g Number <optional>
0

Green value (floating point data)

b Number <optional>
0

Blue value (floating point data)

a Number <optional>
1

Alpha value (floating point data)

Source:
Returns:
Type
Color

toFloat32Array(arr) → {Float32Array}

Returns a Float32Array representation of the color.

Parameters:
Name Type Argument Description
arr Float32Array <optional>

The out Float32Array

Source:
Returns:
Type
Float32Array

toString() → {String}

Return a string representation of the color.

Source:
Returns:
Type
String

Generated with wicked.

Clone this wiki locally