-
Notifications
You must be signed in to change notification settings - Fork 3
Color.API
Represents color information in rgba format.
| 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:
-
Alpha value (floating point data)
- Number
- Source:
-
Blue value (floating point data)
- Number
- Source:
-
Green value (floating point data)
- Number
- Source:
-
Red value (floating point data)
- Number
- Source:
-
<static> black() → {Color}
-
Create a new color with r=0,g=0,b=0,a=1
- Source:
- Type
- Color
-
<static> blue() → {Color}
-
Create a new color with r=0,g=0,b=1,a=1
- Source:
- Type
- Color
-
<static> green() → {Color}
-
Create a new color with r=0,g=1,b=0,a=1
- Source:
- Type
- Color
-
<static> red() → {Color}
-
Create a new color with r=1,g=0,b=0,a=1
- Source:
- Type
- Color
-
<static> white() → {Color}
-
Create a new color with r=1,g=1,b=1,a=1
- Source:
- Type
- Color
-
copy(color) → {Color}
-
Returns a copy of the color
Name Type Argument Description colorColor <optional>
The out color
- Source:
- Type
- Color
-
Check if color equals another color.
Name Type Description colorColor Another color
- Source:
- Type
- boolean
-
set(color) → {Color}
-
Set from another color.
Name Type Description colorColor Another color
- Source:
- Type
- Color
-
setf(r, g, b, a) → {Color}
-
Set rgba components.
Name Type Argument Default Description rNumber <optional>
0 Red value (floating point data)
gNumber <optional>
0 Green value (floating point data)
bNumber <optional>
0 Blue value (floating point data)
aNumber <optional>
1 Alpha value (floating point data)
- Source:
- Type
- Color
-
Returns a Float32Array representation of the color.
Name Type Argument Description arrFloat32Array <optional>
The out Float32Array
- Source:
- Type
- Float32Array
-
Return a string representation of the color.
- Source:
- Type
- String