Skip to content

Color

Fields

Name Type Description
r float Red color, fraction from 0.0 to 1.0
g float Green color, fraction from 0.0 to 1.0
b float Blue color, fraction from 0.0 to 1.0
a float Alpha color, fraction from 0.0 to 1.0

Functions

new

This function has no parameters.

Return value

Name Type Description
clr Color New instance of a Color
local clr = Color.new()

new

Name Type Description
r float Red (0.0 - 1.0)
g float Green (0.0 - 1.0)
b float Blue (0.0 - 1.0)
a float Alpha (0.0 - 1.0)

Return value

Name Type Description
clr Color New instance of a Color
local clr = Color.new(0.5, 0.5, 0.5, 1.0)

RGBA

Name Type Description
r int Red (0 - 255)
g int Green (0 - 255)
b int Blue (0 - 255)
a int Alpha (0 - 255)

Return value

Name Type Description
clr Color New instance of a Color
local clr = Color.RGBA(100, 255, 0, 255)

HSLA

Name Type Description
h float Hue (0.0 - 1.0)
s float Saturation (0.0 - 1.0)
l float Lightness (0.0 - 1.0)
a float Alpha (0.0 - 1.0)

Return value

Name Type Description
clr Color New instance of a Color
local clr = Color.HSLA(0.5, 0.5, 0.5, 1.0)