Color
Associated namespace: sm.color
A userdata object representing an RGBA color value.
Member Values
r
Color.r (number): The red component value.
g
Color.g (number): The green component value.
b
Color.b (number): The blue component value.
a
Color.a (number): The alpha/transparency value.
Operators
| Operator | Description |
|---|---|
| Color + Color | Returns the component-wise sum of two colors. |
| Color - Color | Returns the component-wise difference of two colors. |
| Color / Color | Returns the component-wise quotient of two colors. |
| Color / number | Returns the component-wise quotient of a color and a scalar. |
| Color * Color | Returns the component-wise product of two colors. |
| Color * number | Returns the component-wise product of a color and a scalar. |
| Color == Color | Checks if two colors are equal. |
| tostring(Color) | Converts the color to a hex color string. |
Member Functions
getHexStr
local hex = color:getHexStr()
Returns the color's value as a hex color string.
Parameters:
color(Color): The color.
Returns:
hex(string): The hex color string.