Primitive Class Color
Represents an RGBA or RGB color.
Components are specified as values clamped to the range [0, 255].
Members
r | (int) Red component. |
g | (int) Green component. |
b | (int) Blue component. |
a | (int) Alpha component (0 = invisible, 255 = opaque). |
Functions
Color(R, G, B, [A]) | Create a Color object. |
__tostring(color) |
Members
- r
- (int) Red component.
- g
- (int) Green component.
- b
- (int) Blue component.
- a
- (int) Alpha component (0 = invisible, 255 = opaque).
Functions
- Color(R, G, B, [A])
-
Create a Color object.
Parameters:
- R int Red component.
- G int Green component.
- B int Blue component.
- A int Alpha (transparency) component. Default: 255.
Returns:
-
Color
A new Color object.
- __tostring(color)
-
Parameters:
- color Color This color.
Returns:
-
string
A string representing R, G, B, and A values.