Difference between revisions of "Term.isColor"
From ComputerCraft Wiki
(Removed chance of getting imaginary OCD by code. Fixed example not doing what it says it does.) |
m (Grammar, we use it.) |
||
| Line 8: | Line 8: | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
| − | |desc=This program | + | |desc=This program verifies 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 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 | |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 | ||
}} | }} | ||
Revision as of 10:00, 23 January 2013
| 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 |