Color

Represents a RGBA color (Red, Green, Blue, Alpha)

Constructors

Color ( number red, number green, number blue, number alpha optional )

Creates a Color with given red, green, blue and (optional) alpha values.

Parameters can be between 0.0 and 1.0 or between 0 and 255.

local red = Color(255, 0, 0)
local alsoRed = Color(1.0, 0.0, 0.0)
local semiTransparentRed = Color(1.0, 0.0, 0.0, 0.5)

Functions

nil Clear ( )

Returns the clear color (R:0, G:0, B:0, A:0). This is a property of the global table, and should be called as Color.Clear.

nil Copy ( )

Returns a new Color instance with the same color.

nil Lerp ( Color from, Color to, number ratio )

Sets this Color to the linear interpolation between two given Color at a given ratio.

nil Set ( number r, number g, number b, number a optional, boolean light optional )

Sets this Color's components to the given values.

Properties

Shortcut to Color.Alpha.

Color's alpha component.

Shortcut to Color.Blue.

Color's blue component.

Shortcut to Color.Green.

Color's green component.

Shortcut to Color.Hue.

Color's HSV hue component, in degrees. Value range from 0° to 360°.

Shortcut to Color.Red.

This is a read-only getter of the global Color object, returns a random opaque color.

Color's red component.

Shortcut to Color.Saturation.

Color's HSV saturation component. Value range from 0.0 to 1.0.

Shortcut to Color.Value.

Color's HSV value component. Value range from 0.0 to 1.0.