Type Color

Colours in RGB space. This is a direct binding to the GLua colour type.

Methods

SetUnpacked( r, g, b, a ) Sets the RGBA components of the colour.
ToHSL() Returns the colour in HSL space.
ToHSV() Returns the colour in HSV space.
ToNormalizedHSV() Returns the colour in HSV space, normalising the hue to between 0 and 1.
ToTable() Returns the colour as an (r, g, b, a) array.
ToVector() Returns the RGB values as a Vector, with each component normalised to be between 0 and 1.
Unpack() Returns the components of the colour.


Methods

Color:SetUnpacked( r, g, b, a )
Sets the RGBA components of the colour.

Environment:

Shared

Parameters:

  • r: The red value to set.
  • g: The green value to set.
  • b: The blue value to set.
  • a: The alpha value to set.
Color:ToHSL()
Returns the colour in HSL space.

Environment:

Shared

Return values:

  1. (number) The hue of the colour in degrees between 0 and 360.
  2. (number) The saturation of the colour between 0 and 1.
  3. (number) The lightness of the colour between 0 and 1.
Color:ToHSV()
Returns the colour in HSV space.

Environment:

Shared

Return values:

  1. (number) The hue of the colour in degrees between 0 and 360.
  2. (number) The saturation of the colour between 0 and 1.
  3. (number) The value of the colour between 0 and 1.
Color:ToNormalizedHSV()
Returns the colour in HSV space, normalising the hue to between 0 and 1.

Environment:

Shared

Return values:

  1. (number) The hue of the colour between 0 and 1.
  2. (number) The saturation of the colour between 0 and 1.
  3. (number) The value of the colour between 0 and 1.
Color:ToTable()
Returns the colour as an (r, g, b, a) array.

Environment:

Shared
Color:ToVector()
Returns the RGB values as a Vector, with each component normalised to be between 0 and 1.

Environment:

Shared
Color:Unpack()
Returns the components of the colour.

Environment:

Shared

Return values:

  1. (number) The red value.
  2. (number) The green value.
  3. (number) The blue value.
  4. (number) The alpha value.

Valid XHTML 1.0!