new Color(r, g, b, a)
Creates a new instance of Color.
Parameters:
Name | Type | Description |
---|---|---|
r |
number | the R (red) value (0-255) |
g |
number | the G (green) value (0-255) |
b |
number | the B (blue) value (0-255) |
a |
number | the A (alpha) value (0-1.0) |
Properties:
Name | Type | Description |
---|---|---|
R |
number | the R (red) value (0-255) |
G |
number | the G (green) value (0-255) |
B |
number | the B (blue) value (0-255) |
A |
number | the A (alpha) value (0-1.0) |
Methods
-
toHexString()
-
Returns the color as a hex string e.g. #FFFFFF
-
toString()
-
Outputs the current color as a CSS3 RGB color string.
Example
ex. "rgb(0,0,0)" or "rgba(0,255,0,0.5)"