Difference between revisions of "Term.isColor"
From ComputerCraft Wiki
m (Moved to CAT:APIFunctions) |
(Removed chance of getting imaginary OCD by code. Fixed example not doing what it says it does.) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=term.isColor | |name=term.isColor | ||
− | |returns= | + | |returns=Returns true if it's an advanced computer. |
|api=term | |api=term | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Returns if | + | |desc=Returns true if it's an advanced computer. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=This program verify if the computer can display colors. <br />If it can, the computer | + | |desc=This program verify if the computer can display colors. <br />If it can, the computer clears the screen and changes the background to lime, otherwise, it turns computer off. |
− | |code=local | + | |code=local isAdvanced = term.isColor and term.isColor() <br />if isAdvanced then <br /> term.setBackgroundColor(colors.lime)<br /> term.clear()<br />else<br /> os.shutdown()<br />end |
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Revision as of 08:01, 23 January 2013
Function term.isColor | |
Returns true if it's an advanced computer. | |
Syntax | term.isColor() |
Returns | Returns true if it's an advanced computer. |
Part of | ComputerCraft |
API | term |