Difference between revisions of "Term.setTextColor"

From ComputerCraft Wiki
Jump to: navigation, search
(Updated/Improved)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
{{Function
 
{{Function
|name=Term.setTextColor
+
|name=term.setTextColor
|args= [http://computercraft.info/wiki/index.php?title=Colors#Colors color] code
+
|args= {{type|number}} color code
|returns=None
+
|returns={{type|nil}}
 
|api=term
 
|api=term
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=changes the color of your font (For common use add the decimal code of the color)
+
|desc=Changes the text color of the terminal.  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 four colors: black, white, gray and light gray. Also available as '''term.setTextColour''' for British spelling.
 +
<br>
 +
See also: [[term.getTextColor]]()
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Makes the words hello world! grey |code=Term.SetTextcolor(128)<br>print("Hello World!")
+
|desc=Outputs the words "Hello World!" in color green:
 +
|code= '''term.setTextColor( [[Colors_(API)|colors.green]] )'''
 +
[[print]]( "Hello World! ")
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 12:13, 28 June 2015


Grid Redstone.png  Function term.setTextColor
Changes the text color of the terminal. 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 four colors: black, white, gray and light gray. Also available as term.setTextColour for British spelling.


See also: term.getTextColor()
Syntax term.setTextColor(number color code)
Returns nil
Part of ComputerCraft
API term

Examples

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