LifeLua 30-05-2025
Documentation for LifeLua
Loading...
Searching...
No Matches
color

Color library. More...

Functions

color color.new (number r, number g, number b, number a)
 
number color.r (color color, number r)
 
number color.g (color color, number g)
 
number color.b (color color, number b)
 
number color.a (color color, number a)
 
color color.add (color color1, color color2)
 
color color.sub (color color1, color color2)
 
color color.blend (color color1, color color2)
 
color color.mix (color color1, color color2, number p1, number p2)
 
color tocolor (color color1, color color2, number p1, number p2)
 

Detailed Description

Method calling will work on most of the functions here (e. g. color:a, color:sub, etc.)

Function Documentation

◆ color.a()

number color.a ( color color,
number a )

Gets or sets the alpha in a color

Parameters
aOptional, new value for the alpha in the color

◆ color.add()

color color.add ( color color1,
color color2 )

Sum 2 colors

◆ color.b()

number color.b ( color color,
number b )

Gets or sets the blue in a color

Parameters
bOptional, new value for the blue in the color

◆ color.blend()

color color.blend ( color color1,
color color2 )

Blends 2 colors

◆ color.g()

number color.g ( color color,
number g )

Gets or sets the green in a color

Parameters
gOptional, new value for the green in the color

◆ color.mix()

color color.mix ( color color1,
color color2,
number p1,
number p2 )

Blends 2 colors by 2 percentages

◆ color.new()

color color.new ( number r,
number g,
number b,
number a )

Creates a new color

Parameters
aAlpha is optional, will default to 255 (maximum)

◆ color.r()

number color.r ( color color,
number r )

Gets or sets the red in a color

Parameters
rOptional, new value for the red in the color

◆ color.sub()

color color.sub ( color color1,
color color2 )

Subtract 2 colors

◆ tocolor()

color tocolor ( color color1,
color color2,
number p1,
number p2 )

Converts an integer (e. g. 0xFFFF0000) to a color