Difference between revisions of "Term.setTextColor"

From ComputerCraft Wiki
Jump to: navigation, search
m (Moved to CAT:APIFunctions)
(Note re non-colour systems.)
Line 6: Line 6:
 
|api=term
 
|api=term
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Changes the foreground color of text subsequently written to the screen.  For ease of use, it is best to use the color codes provided in the colors API.
+
|desc=Changes the foreground color of text subsequently written to the screen.  For ease of use, it is best to use the color codes provided in the [[colors (API)|colors API]]. Note that non-advanced systems only have black and white displays, though the text color may still be set to either of these two shades.<br><br>
 +
 
 +
See also: [[term.setBackgroundColor|term.setBackgroundColor()]]
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Makes the words Hello World! green.
+
|desc=Outputs the words "Hello World!" green:
|code=term.setTextColor(colors.green)<br>print("Hello World!")
+
|code= term.setTextColor(colors.green)
 +
print("Hello World!")
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Revision as of 12:20, 6 April 2014


Grid Redstone.png  Function term.setTextColor
Changes the foreground color of text subsequently written to the screen. For ease of use, it is best to use the color codes provided in the colors API. Note that non-advanced systems only have black and white displays, though the text color may still be set to either of these two shades.

See also: term.setBackgroundColor()
Syntax term.setTextColor(color code)
Returns None
Part of ComputerCraft
API term

Examples

Grid paper.png  Example
Outputs the words "Hello World!" green:
Code
term.setTextColor(colors.green)
print("Hello World!")