Color
- class Communicator.Color()
An object representing an RGB Color. Values are specified in the 0-255 range.
Constructors
Methods
Constructors
Properties
- Color.b
- Type
number
- Color.g
- Type
number
- Color.r
- Type
number
Methods
assign
copy
equals
forJson
- Color.forJson()
- Deprecated
Use
toJson
instead.- Return type
Object
fromFloatArray
- Color.fromFloatArray(arr)
Sets this color from an array of normalized floating point values
- Arguments
arr (
[number]()
) –
- Return type
void
getFloatArray
- Color.getFloatArray()
Gets an array of floating point values representing this color. Values are clamped in the 0.0 - 1.0 range.
- Return type
(number, number, number)
- Returns
array of floating point values for this color.
set
- Color.set(r, g, b)
Sets the color object. Values are specified in the 0-255 range.
- Arguments
r (
number()
) – red color componentg (
number()
) – green color componentb (
number()
) – blue color component
- Return type
void
setFromFloat
- Color.setFromFloat(r, g, b)
Sets the color object from floating point values. Values are specified in the 0.0-1.0 range.
- Arguments
r (
number()
) – red color componentg (
number()
) – green color componentb (
number()
) – blue color component
- Return type
void
toFloatArray
- Color.toFloatArray(arr)
Populates an array with floating point values for this color. Values are clamped in the 0.0 - 1.0 range.
- Arguments
arr (
[number]()
) – array whose first three elements will be populated with the r,g, and b values of this color respectively.
- Return type
void
toJson
- Color.toJson()
Creates an object ready for JSON serialization.
- Return type
Object
- Returns
The prepared object.