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): colorA color from its red, green and blue, each from 0 to 255: color.rgb(255, 136, 0) is orange.
| Value | Type | |
|---|---|---|
r | number | |
g | number | |
b | number |
Gives: color.
color.hexfunction
color.hex(text: string): colorA color written as hex, as a color picker shows it: color.hex("#FF8800"). The # can be left out, and "#F80" is short for "#FF8800".
| Value | Type | |
|---|---|---|
text | string |
Gives: color.
color.hsvfunction
color.hsv(h: number, s: number, v: number): colorA 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.
| Value | Type | |
|---|---|---|
h | number | |
s | number | |
v | number |
Gives: color.
color.lerpfunction
color.lerp(a: color, b: color, t: number): colorThe same as a:lerp(b, t).
| Value | Type | |
|---|---|---|
a | color | |
b | color | |
t | number |
Gives: color.
color.themefunction
color.theme(slot: Theme): colorA 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).
| Value | Type | |
|---|---|---|
slot | Theme | One of: water, floorA, floorB, block, blockLight, glow, waterDeep, waterTops, shadowColor. |
Gives: color.
color.whitefunction
color.white: colorWhite: color.rgb(255, 255, 255).
color.blackfunction
color.black: colorBlack: color.rgb(0, 0, 0).
color.grayfunction
color.gray: colorGray: color.rgb(128, 128, 128).
color.redfunction
color.red: colorRed: color.rgb(255, 0, 0).
color.orangefunction
color.orange: colorOrange: color.rgb(255, 136, 0).
color.yellowfunction
color.yellow: colorYellow: color.rgb(255, 255, 0).
color.greenfunction
color.green: colorGreen: color.rgb(0, 255, 0).
color.cyanfunction
color.cyan: colorCyan: color.rgb(0, 255, 255).
color.bluefunction
color.blue: colorBlue: color.rgb(0, 0, 255).
color.purplefunction
color.purple: colorPurple: color.rgb(136, 0, 255).
color.pinkfunction
color.pink: colorPink: color.rgb(255, 102, 204).
color.rfunction
c.r: numberHow much red the color has, from 0 to 255.
color.gfunction
c.g: numberHow much green the color has, from 0 to 255.
color.bfunction
c.b: numberHow much blue the color has, from 0 to 255.
color:toHexfunction
c:toHex(): stringThe color written as hex, like "#FF8800".
Gives: string.
color:toRGBfunction
c:toRGB(): number, number, numberIts red, green and blue, from 0 to 255: local r, g, b = c:toRGB().
Gives: number, number, number.
color:toHSVfunction
c:toHSV(): number, number, numberIts 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): colorA 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.
| Value | Type | |
|---|---|---|
other | color | |
t | number |
Gives: color.