Class Color
An RGBA or RGB color.
Components are specified in bytes; all values are clamped to [0, 255].
Color.r |
(int) red component |
Color.g |
(int) green component |
Color.b |
(int) blue component |
Color.a |
(int) alpha component (255 is opaque, 0 is invisible) |
-
Color.r
-
(int) red component
-
Color.g
-
(int) green component
-
Color.b
-
(int) blue component
-
Color.a
-
(int) alpha component (255 is opaque, 0 is invisible)
Methods
-
Color.new (R, G, B)
-
Parameters:
- R
int
red component
- G
int
green component
- B
int
blue component
Returns:
A Color object.
-
Color.new (R, G, B, A)
-
Parameters:
- R
int
red component
- G
int
green component
- B
int
blue component
- A
int
alpha component (255 is opaque, 0 is invisible)
Returns:
A Color object.
-
Color:__tostring (color)
-
Parameters:
Returns:
string
A string showing the r, g, b, and a values of the color