Color
Associated namespace: sm.color
A userdata object representing a color.
Values:-
r
[ number ]Get
: The red value of the color (0.0 - 1.0).Set
: Sets the red value of the color (0.0 - 1.0).
-
g
[ number ]Get
: The green value of the color (0.0 - 1.0).Set
: Sets the green value of the color (0.0 - 1.0).
-
b
[ number ]Get
: The blue value of the color (0.0 - 1.0).Set
: Sets the blue value of the color (0.0 - 1.0).
-
a
[ number ]Get
: The alpha value of the color (0.0 - 1.0).Set
: Sets the alpha value of the color (0.0 - 1.0).
Operation | Description |
---|---|
Color == Color | Checks if two colors are equal. |
Color + Color | Returns the sum of two colors, adding each component. |
Color / Color | Returns the quotient of two colors, dividing each component. |
Color / number | Returns the quotient of a color and a scalar. |
Color * Color | Returns the product of two colors, multiplying each component. |
Color * number | Returns the product of a color and a scalar. |
Color - Color | Returns the difference of two colors, subtracting each component. |
tostring( Color ) | Returns the color as a string. |
Functions
getHexStr
color:getHexStr()
Returns the hex representation of the color.
Arguments:color
[ Color ]: The color.
- [ string ]: The color's hex string.