Module ctr.gfx.color

The gfx.color module

Usage:

    local color = require("ctr.gfx.color")

Functions

setDefault (color) Set a color as the default one.
getDefault () Return the default color.
setBackground (color) Set a color as the background one.
getBackground () Return the background color.
RGBA8 (r, g, b[, a=255]) Return a color from red, green, blue and alpha values.
hex (hex) Return a color from a hexadecimal value.


Functions

setDefault (color)
Set a color as the default one.

Parameters:

  • color integer the color to set as the default one.
getDefault ()
Return the default color.

Returns:

    integer default color
setBackground (color)
Set a color as the background one.

Parameters:

  • color integer the color to set as the background one.
getBackground ()
Return the background color.

Returns:

    integer background color
RGBA8 (r, g, b[, a=255])
Return a color from red, green, blue and alpha values.

Parameters:

  • r integer the red value (0-255)
  • g integer the green value (0-255)
  • b integer the blue value (0-255)
  • a integer the alpha (opacity) value (0-255) (default 255)

Returns:

    integer the color
hex (hex)
Return a color from a hexadecimal value.

Parameters:

  • hex integer the hexadecimal color code: 0xRRGGBBAA

Returns:

    integer the color
generated by LDoc 1.4.3 Last updated 2017-06-05 14:35:27