Color - truemedian/Discordia GitHub Wiki
Wrapper for 24-bit colors packed as a decimal value. See the static constructors for more information.
Constructs a new Color object from a hexadecimal string. The string may or may not be prefixed by
#
; all other characters are interpreted as a hex string.
Name Type hex string Returns: Color
Constructs a new Color object from RGB color values. Values are allowed to overflow, though one component will not overflow to the next component.
Name Type r number g number b number Returns: Color
Constructs a new Color object from HSV color values. Hue is allowed to overflow while saturation and value are clamped to [0, 1].
Name Type h number s number v number Returns: Color
Constructs a new Color object from HSL color values. Hue is allowed to overflow while saturation and lightness are clamped to [0, 1].
Name Type h number s number l number Returns: Color
Returns the hexadecimal string that represents the color value.
Returns: string
Returns the red, green, and blue values that are packed into the color value.
Returns: number, number, number
Returns the hue, saturation, and value that represents the color value.
Returns: number, number, number
Returns the hue, saturation, and lightness that represents the color value.
Returns: number, number, number
Sets the color's red-level.
Returns: nil
Sets the color's green-level.
Returns: nil
Sets the color's blue-level.
Returns: nil
Returns a new copy of the original color object.
Returns: Color
The raw decimal value that represents the color value.
Type: number
The value that represents the color's red-level.
Type: number
The value that represents the color's green-level.
Type: number
The value that represents the color's blue-level.
Type: number