Appearance
Color
Inherits: Class
Methods
ColorText
lua
function Color:ColorText(text)
-> stringColors a text string with the color.
Parameters:
| Name | Type | Description |
|---|---|---|
text | string | number | The text string to color |
Returns:
| Type | Description |
|---|---|
string |
GetFractionalRGBA
lua
function Color:GetFractionalRGBA()
-> number, number, number, numberGets the RGBA values of the color as values from 0 to 1.
Returns:
| Name | Type | Description |
|---|---|---|
r | number | |
g | number | |
b | number | |
a | number |
GetHex
lua
function Color:GetHex()
-> stringGets the hex string representation of the color.
Returns:
| Type | Description |
|---|---|
string |
GetHexNoAlpha
lua
function Color:GetHexNoAlpha()
-> stringGets the hex string representation of the color without the alpha channel.
Returns:
| Type | Description |
|---|---|
string |
GetOpacity
lua
function Color:GetOpacity(opacityPct)
-> selfGets a version of the color with a different opacity.
Parameters:
| Name | Type | Description |
|---|---|---|
opacityPct | number | The opacity percentage |
Returns:
| Type | Description |
|---|---|
self |
GetRGBA
lua
function Color:GetRGBA()
-> number, number, number, numberGets the RGBA values of the color as values from 0 to 255.
Returns:
| Name | Type | Description |
|---|---|---|
r | number | |
g | number | |
b | number | |
a | number |
GetTextColorPrefix
lua
function Color:GetTextColorPrefix()
-> stringGets the prefix used to color a text string.
Returns:
| Type | Description |
|---|---|
string |
GetTint
lua
function Color:GetTint(tintPct)
-> selfGets a tinted version of the color.
Parameters:
| Name | Type | Description |
|---|---|---|
tintPct | number | The tint percent |
Returns:
| Type | Description |
|---|---|
self |
IsLight
lua
function Color:IsLight()
-> booleanReturns whether or not the color is considered light.
Returns:
| Type | Description |
|---|---|
boolean |
SetRGBA
lua
function Color:SetRGBA(r, g, b, a)Sets the RGBA values of the color as values from 0 to 255.
Parameters:
| Name | Type | Description |
|---|---|---|
r | number | |
g | number | |
b | number | |
a | number |
__equals
lua
function Color:__equals(other)Parameters:
| Name | Type | Description |
|---|---|---|
other | `` |
__init
lua
function Color:__init(r, g, b, a)Parameters:
| Name | Type | Description |
|---|---|---|
r | `` | |
g | `` | |
b | `` | |
a | `` |
__tostring
lua
function Color:__tostring()Functions
HexToRGBA
lua
function Color.HexToRGBA(hex)
-> number, number, number, numberConverts a hex string into an RGB value.
Parameters:
| Name | Type | Description |
|---|---|---|
hex | string | The hex string |
Returns:
| Name | Type | Description |
|---|---|---|
r | number | |
g | number | |
b | number | |
a | number |
IsColorValue
lua
function Color.IsColorValue(arg)
-> booleanReturns whether or not the argument is a color value object.
Parameters:
| Name | Type | Description |
|---|---|---|
arg | any | The argument to check |
Returns:
| Type | Description |
|---|---|
boolean |
IsValidHexRGB
lua
function Color.IsValidHexRGB(str)
-> booleanReturns whether or not the passed string is a valid hex RGB string.
Parameters:
| Name | Type | Description |
|---|---|---|
str | string | The value to check |
Returns:
| Type | Description |
|---|---|
boolean |
NewFromHex
lua
function Color.NewFromHex(hex)
-> ColorCreate a new color value object from a hex string.
Parameters:
| Name | Type | Description |
|---|---|---|
hex | string | The hex string which represents the color (in either "#AARRGGBB" or "#RRGGBB" format) |
Returns:
| Type | Description |
|---|---|
Color |