term.isColor

From ComputerCraft Wiki
Revision as of 07:56, 11 November 2012 by 67.189.72.22 (Talk) (Fix example)

Jump to: navigation, search


Grid Redstone.png  Function term.isColor
Returns if the computer can display colors.
Syntax term.isColor()
Returns If the computer can display colors.
Part of ComputerCraft
API term

Examples

Grid paper.png  Example
This program verify if the computer can display colors.
If it can, the computer set the background lime, otherwise, it shutdowns the computer.
Code
local advanced = term.isColor() 
if advanced == true then
term.setBackgroundColor(colors.lime)
else
os.shutdown()
end