Difference between revisions of "SetBackgroundColor Command"
From GeoGebra Manual
(added new syntax) |
m (indentation) |
||
Line 2: | Line 2: | ||
{{command|scripting|US_version=SetBackgroundColor|non-US_version=SetBackgroundColour}} | {{command|scripting|US_version=SetBackgroundColor|non-US_version=SetBackgroundColour}} | ||
;SetBackgroundColor( <Object>, <Red>, <Green>, <Blue> ) | ;SetBackgroundColor( <Object>, <Red>, <Green>, <Blue> ) | ||
− | :Changes the background color of given object. This is used for Texts and for objects in the Spreadsheet. The red, green and blue represent amount of corresponding color component, 0 being minimum and 1 maximum. Number ''t'' exceeding this interval is mapped to it using function <math>2\left|\frac{t}2-\mathrm round\left(\frac{t}2\right)\right|</math>. | + | :Changes the background color of given object. This is used for ''Texts'' and for objects in the ''Spreadsheet''. The red, green and blue represent amount of corresponding color component, 0 being minimum and 1 maximum. Number ''t'' exceeding this interval is mapped to it using function <math>2\left|\frac{t}2-\mathrm round\left(\frac{t}2\right)\right|</math>. |
;SetBackgroundColor( <Object>, <"Color"> ) | ;SetBackgroundColor( <Object>, <"Color"> ) | ||
− | :Changes the background color of given object. This is used for ''Texts'' and for objects in the Spreadsheet. The color is entered as [[Texts|text]], that may be: | + | :Changes the background color of given object. This is used for ''Texts'' and for objects in the ''Spreadsheet''. The color is entered as [[Texts|text]], that may be: |
:* an English color name (see [[Reference:Colors]]). Some of them can be also used in national languages and are listed below. | :* an English color name (see [[Reference:Colors]]). Some of them can be also used in national languages and are listed below. | ||
::{{note| 1=If you use this command in a GeoGebraScript, you must use the English color names}} | ::{{note| 1=If you use this command in a GeoGebraScript, you must use the English color names}} | ||
Line 13: | Line 13: | ||
;SetBackgroundColor( <"Color"> ) | ;SetBackgroundColor( <"Color"> ) | ||
:Changes the background color of the active Graphics View | :Changes the background color of the active Graphics View | ||
− | {{note| 1=If you use this command in a GeoGebraScript, you must use the English color names}} | + | :{{note| 1=If you use this command in a GeoGebraScript, you must use the English color names}} |
{{TableOfColors}} | {{TableOfColors}} |
Revision as of 12:29, 23 February 2018
This command differs among variants of English:
|
- SetBackgroundColor( <Object>, <Red>, <Green>, <Blue> )
- Changes the background color of given object. This is used for Texts and for objects in the Spreadsheet. The red, green and blue represent amount of corresponding color component, 0 being minimum and 1 maximum. Number t exceeding this interval is mapped to it using function 2\left|\frac{t}2-\mathrm round\left(\frac{t}2\right)\right|.
- SetBackgroundColor( <Object>, <"Color"> )
- Changes the background color of given object. This is used for Texts and for objects in the Spreadsheet. The color is entered as text, that may be:
- an English color name (see Reference:Colors). Some of them can be also used in national languages and are listed below.
- Note: If you use this command in a GeoGebraScript, you must use the English color names
- an hexadecimal string of the type #AARRGGBB or #RRGGBB, where AA defines transparency (00 full transparency to FF full opacity), RR defines the red component, GG the green one and BB the blue one.
- Example:
SetBackgroundColor(text1, "#80FF0000")
sets the background color of exixting text1 as pink, with a 50% transparency.
- SetBackgroundColor( <Red>, <Green>, <Blue> )
- Changes the background color of the active Graphics View
- SetBackgroundColor( <"Color"> )
- Changes the background color of the active Graphics View
- Note: If you use this command in a GeoGebraScript, you must use the English color names
- Black
- Dark Gray
- Gray
- Dark Blue
- Blue
- Dark Green
- Green
- Maroon
- Crimson
- Red
- Magenta
- Indigo
- Purple
- Brown
- Orange
- Gold
- Lime
- Cyan
- Turquoise
- Light Blue
- Aqua
- Silver
- Light Gray
- Pink
- Violet
- Yellow
- Light Yellow
- Light Orange
- Light Violet
- Light Purple
- Light Green
- White