Skip to content
DevelopedLogic edited this page Apr 9, 2018 · 6 revisions

Here are the new functions that aren't explained in the original wiki.

term.setPaletteColor

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

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.