Color
A userdata object representing a color.
Values:
-
Get: Returns the alpha value of a color.Set: Sets the alpha value of a color.
-
Get: Returns the blue value of a color.Set: Sets the blue value of a color.
-
Get: Returns the green value of a color.Set: Sets the green value of a color.
-
Get: Returns the red value of a color.Set: Sets the red value of a color.
Operations:
| Operation | Returns | Description |
|---|---|---|
Color + Color |
Color | Returns the sum of two colors, adding each component. |
Color / Color |
Color | Returns the quotient of two colors, dividing each component. |
Color / number |
Color | Returns the quotient of a color and a scalar. |
Color == Color |
boolean | Checks if two colors are equal. |
Color * Color |
Color | Returns the product of two colors, multiplying each component. |
Color * number |
Color | Returns the product of a color and a scalar. |
Color - Color |
Color | Returns the difference of two colors, subtracting each component. |
tostring(Color) |
string | Returns the color as a string. |
Functions
getGuiColorStr
color:getGuiColorStr( )
Get the json gui color representation of the color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Color | The color object. |
Returns:
| Type | Description |
|---|---|
| string | Json gui color string. |
getHexStr
color:getHexStr( )
Get the hex representation of the color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Color | The color object. |
Returns:
| Type | Description |
|---|---|
| string | Hex string. |
getUintRgba
color:getUintRgba( )
Get the uint rgba representation of the color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Color | The color object. |
Returns:
| Type | Description |
|---|---|
| integer | color value. |