⚠️ This site is under development, some artefacts may be missing or incomplete.
PIXEL UI
Color

Color

Global Methods

The following color methods are accessible via the PIXEL global table:

Color PIXEL.CopyColor( Color )

Creates a copy of the given color.

Color PIXEL.OffsetColor( Color, number )

Offsets the RGB components of the colour by the given amount.

Color PIXEL.LerpColor( number, Color, Color )

Performs linear interpolation between two colors.

Color PIXEL.GetRainbowColor()

Provides a colour which cycles through the rainbow.

boolean PIXEL.IsColorEqualTo( Color, Color )

Determines whether two colors are equal to one another.

boolean PIXEL.IsColorLight( Color )

Determines whether a color is considered light (greater than 0.5 lightness).

string PIXEL.ColorToHex( Color )

Converts a color into a hexadecimal string.

number, number, number PIXEL.ColorToHSL( Color )

Converts a color to its HSL (Hue, Saturation, Lightness) representation.

Color PIXEL.HexToColor( string )

Converts a hexadecimal string to a color.

Color PIXEL.HSLToColor( number, number, number, number )

Converts HSL (Hue, Saturation, Lightness) values to a color.

Color Extension Methods

The Color (opens in a new tab) metatable is extended by PIXEL UI to include the following methods:

Color Color:Copy()

A new color instance with the same values as the original color.

Color Color:Offset( number )

Offsets the RGB components of the color the method was called on by the given amount.

Color Color:Lerp( number, number )

Performs linear interpolation starting from the color the method was called on.

boolean Color:EqualTo( Color )

Determines whether the color the method was called on is equal to the one provided.

boolean Color:IsLight()

Determines whether the color the method was called on is considered light (greater than 0.5 lightness).