Class Common.Color
Color class.
Shared functions and properties for color manipulations.
Data Structures
.color | The color table. |
Methods
Common.Color.FromHex (val) | Converts hexadecimal to color table. |
Common.Color.ToHex (r[, g[, b]]) | Converts color to hexadecimal string. |
Data Structures
- .color
-
The color table.
- r int Red color composition (Range = 0~255).
- g int Green color composition (Range = 0~255).
- b int Blue color composition (Range = 0~255).
- a int Alpha/opaque/transparency (Range = 0~255). (default nil)
Methods
- Common.Color.FromHex (val)
-
Converts hexadecimal to color table.
Parameters:
- val number or string The hexadecimal value.
Returns:
-
.color
The color table.
- Common.Color.ToHex (r[, g[, b]])
-
Converts color to hexadecimal string.
Parameters:
- r int or .color Red color composition. | A color-compatible table.
- g
int
Green color composition (Ignored if
r
is table). (optional) - b
int
Blue color composition (Ignored if
r
is table). (optional)
Returns:
-
string
A hexadecimal string.