-
Notifications
You must be signed in to change notification settings - Fork 195
Term
Lignum edited this page Mar 4, 2018
·
6 revisions
Here are the new functions that aren't explained in the original wiki.
term.setPaletteColor(color, r, g, b)
returns nil
This function lets you set every color ( for example: colors.red
) to an RGB color (with each component in the interval [0;1])
Example
term.setPaletteColor(colors.yellow, 1, 1, 0)
This will set everything that has the color colors.yellow
to solid yellow (1, 1, 0)
term.getPaletteColor(color)
returns r, g, b
This function lets you get the RGB of an color ( for example: colors.red
).
Example
local r, g, b = term.getPaletteColor(colors.yellow)
print("Red: " .. r) --# Red: 1
print("Green: " .. g) --# Green: 1
print("Blue: " .. b) --# Blue: 0
This will print out the palette color of colors.yellow
.