Luawe All pages

color

Colors. Make one with color.rgb, color.hex, color.hsv or by its name (color.red), and give it to a thing: door.color = color.rgb(255, 0, 0). A color is a value like a number: c.r, c.g and c.b read it, and it can't be changed (make a new one).

color.rgbfunction

color.rgb(r: number, g: number, b: number): color

A color from its red, green and blue, each from 0 to 255: color.rgb(255, 136, 0) is orange.

ValueType
rnumber
gnumber
bnumber

Gives: color.

color.hexfunction

color.hex(text: string): color

A color written as hex, as a color picker shows it: color.hex("#FF8800"). The # can be left out, and "#F80" is short for "#FF8800".

ValueType
textstring

Gives: color.

color.hsvfunction

color.hsv(h: number, s: number, v: number): color

A color from its hue, from 0 to 360 (red, yellow, green, cyan, blue, purple, and red again), its saturation, from 0 (gray) to 100 (full), and its value, from 0 (black) to 100 (bright): color.hsv(32, 100, 100) is orange, color.orange.

ValueType
hnumber
snumber
vnumber

Gives: color.

color.lerpfunction

color.lerp(a: color, b: color, t: number): color

The same as a:lerp(b, t).

ValueType
acolor
bcolor
tnumber

Gives: color.

color.themefunction

color.theme(slot: Theme): color

A color of the theme as it is now: color.theme(cat.Theme.water) is the same as theme.water. It is a color value: given to a thing, it stays that color when the theme changes (give the thing cat.Theme.water itself to follow it).

ValueType
slotThemeOne of: water, floorA, floorB, block, blockLight, glow, waterDeep, waterTops, shadowColor.

Gives: color.

color.whitefunction

color.white: color

White: color.rgb(255, 255, 255).

color.blackfunction

color.black: color

Black: color.rgb(0, 0, 0).

color.grayfunction

color.gray: color

Gray: color.rgb(128, 128, 128).

color.redfunction

color.red: color

Red: color.rgb(255, 0, 0).

color.orangefunction

color.orange: color

Orange: color.rgb(255, 136, 0).

color.yellowfunction

color.yellow: color

Yellow: color.rgb(255, 255, 0).

color.greenfunction

color.green: color

Green: color.rgb(0, 255, 0).

color.cyanfunction

color.cyan: color

Cyan: color.rgb(0, 255, 255).

color.bluefunction

color.blue: color

Blue: color.rgb(0, 0, 255).

color.purplefunction

color.purple: color

Purple: color.rgb(136, 0, 255).

color.pinkfunction

color.pink: color

Pink: color.rgb(255, 102, 204).

color.rfunction

c.r: number

How much red the color has, from 0 to 255.

color.gfunction

c.g: number

How much green the color has, from 0 to 255.

color.bfunction

c.b: number

How much blue the color has, from 0 to 255.

color:toHexfunction

c:toHex(): string

The color written as hex, like "#FF8800".

Gives: string.

color:toRGBfunction

c:toRGB(): number, number, number

Its red, green and blue, from 0 to 255: local r, g, b = c:toRGB().

Gives: number, number, number.

color:toHSVfunction

c:toHSV(): number, number, number

Its hue (0 to 360), saturation and value (0 to 100), as color.hsv takes them: local h, s, v = c:toHSV().

Gives: number, number, number.

color:lerpfunction

c:lerp(other: color, t: number): color

A color between this one (t = 0) and the other (t = 1): color.red:lerp(color.blue, 0.5) is half way. t is kept from 0 to 1.

ValueType
othercolor
tnumber

Gives: color.