Difference between revisions of "Term.setBackgroundColor"

From ComputerCraft Wiki
Jump to: navigation, search
(Updated/Improved)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
{{Function
 
{{Function
|name=Term.setBackgroundColor
+
|name=term.setBackgroundColor
|args= [[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 the background of your terminal/monitor (For common use add the decimal code of the color) [Need screen refresh,with term.clear() by example]
+
|desc=Changes the background 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 background color may still be set to either of these four colors: black, white, gray and light gray. Also available as '''term.setBackgroundColour''' for British spelling.
 +
<br>
 +
See also: [[term.getBackgroundColor]]()
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Makes the background of the monitor grey,and clear screen for updating |code=term.setBackgroundColor(128)<br>term.clear()
+
|desc=Writes text with a gray background.
 +
|code= '''term.setBackgroundColor( [[Colors_(API)|colors.gray]] )'''
 +
[[print]]( "I have a gray background" )
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 12:26, 28 June 2015


Grid Redstone.png  Function term.setBackgroundColor
Changes the background 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 background color may still be set to either of these four colors: black, white, gray and light gray. Also available as term.setBackgroundColour for British spelling.


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

Examples

Grid paper.png  Example
Writes text with a gray background.
Code
term.setBackgroundColor( colors.gray )
print( "I have a gray background" )