Difference between revisions of "SetColor Command"

From GeoGebra Manual
Jump to: navigation, search
(added new syntax for color parameter)
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
:* 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}}
:* 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.
+
:* an hexadecimal string of the type #AARRGGBB or #RRGGBB, where ''AA'' defines transparency (01 full transparency to FF full opacity), ''RR'' defines the red component, ''GG'' the green one and ''BB'' the blue one.
::{{example|1=<code>SetColor(text1, "#80FF0000")</code> sets the color of exixting ''text1'' as pink, with a 50% white transparency.}}
+
::{{example|1=<code>SetColor(text1, "#80FF0000")</code> sets the color of existing ''text1'' as red, with a 50% white transparency.}}
  
 
{{TableOfColors}}
 
{{TableOfColors}}

Latest revision as of 12:11, 21 February 2022


SetColor( <Object>, <Red>, <Green>, <Blue> )
Changes the color of given object. 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|.
SetColor( <Object>, <"Color"> )
Changes the color of given object. 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 (01 full transparency to FF full opacity), RR defines the red component, GG the green one and BB the blue one.
Example: SetColor(text1, "#80FF0000") sets the color of existing text1 as red, with a 50% white transparency.



  • 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
 
© 2024 International GeoGebra Institute