Module colour

Functions to create, convert and modify colours

Functions

new (red, green, blue[, alpha=255]) Creates a new colour object.
free (colour) Releases the colour.
getredchannel (colour) Gets the red channel value.
setredchannel (colour, red) Sets the red channel value.
getgreenchannel (colour) Gets the green channel value.
setgreenchannel (colour, green) Sets the green channel value.
getbluechannel (colour) Gets the blue channel value.
setbluechannel (colour, blue) Sets the blue channel value.
getalphachannel (colour) Gets the alpha channel value.
setalphachannel (colour, alpha) Sets the alpha channel value.
setforeground ([colour]) Sets the default foreground colour.
getforeground () Gets the default foreground colour.
setbackground ([colour]) Sets the default foreground colour.
getbackground () Gets the default background colour.
tostring (colour) Gets the string representation of the colour.


Functions

new (red, green, blue[, alpha=255])
Creates a new colour object.

Parameters:

  • red The red channel value (0 - 255).
  • green The green channel value (0 - 255).
  • blue The blue channel value (0 - 255).
  • alpha The alpha channel value (0 - 255). (default 255)
free (colour)
Releases the colour.

Parameters:

  • colour A colour object.
getredchannel (colour)
Gets the red channel value.

Parameters:

  • colour A colour object.
setredchannel (colour, red)
Sets the red channel value.

Parameters:

  • colour A colour object.
  • red The new value.
getgreenchannel (colour)
Gets the green channel value.

Parameters:

  • colour A colour object.
setgreenchannel (colour, green)
Sets the green channel value.

Parameters:

  • colour A colour object.
  • green The new value.
getbluechannel (colour)
Gets the blue channel value.

Parameters:

  • colour A colour object.
setbluechannel (colour, blue)
Sets the blue channel value.

Parameters:

  • colour A colour object.
  • blue The new value.
getalphachannel (colour)
Gets the alpha channel value.

Parameters:

  • colour A colour object.
setalphachannel (colour, alpha)
Sets the alpha channel value.

Parameters:

  • colour A colour object.
  • alpha The new value.
setforeground ([colour])
Sets the default foreground colour.

Parameters:

  • colour The font object to set as default, nil to reset it. (optional)
getforeground ()
Gets the default foreground colour.

Returns:

    Current foreground colour.
setbackground ([colour])
Sets the default foreground colour.

Parameters:

  • colour The font object to set as default, nil to reset it. (optional)
getbackground ()
Gets the default background colour.

Returns:

    Current background colour.
tostring (colour)
Gets the string representation of the colour.

Parameters:

  • colour A colour object.

Returns:

    String representation of the colour.
generated by LDoc 1.4.6 Last updated 2022-08-01 11:21:18