Text SetColor: Difference between revisions
From MultiCharts
(Created page with "Assigns the specified color to the text of a text object with the specified ID number; returns a value of 0 if the color was successfully assigned, and a value of -2 if the sp...") |
m (Reverted edits by 176.8.90.7 (talk) to last revision by JoshM) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Assigns the specified color to the text of a text object with the specified ID number | Assigns the specified color to the text of a text object with the specified ID number. | ||
Text_SetColor returns a value of 0 if the color was successfully assigned, and a value of -2 if the specified object ID number is invalid. | |||
== Usage == | |||
<syntaxhighlight>Text_SetColor(ObjectID,TextColor)</syntaxhighlight> | <syntaxhighlight>Text_SetColor(ObjectID, TextColor)</syntaxhighlight> | ||
== Parameters == | |||
:'''ObjectID''' - a numerical expression specifying the object ID number. | |||
:'''TextColor''' - an expression specifying the text color. | |||
::The color can be specified by a numerical expression representing an [[RGB]] color number or a [[LegacyColorValue|legacy color value]], or by one of 17 [[:Category:Colors|base color words]]. | |||
[[ | |||
[[ | == Notes == | ||
* An object-specific ID number is returned by [[Text_New]] when the text object is created. | |||
* Use [[Text_GetColor]] to get the color of a specific text object. | |||
== Examples == | |||
Assign the color blue to the text of a text object with the ID number of 3: | Assign the color blue to the text of a text object with the ID number of 3: | ||
<syntaxhighlight>Value1=Text_SetColor(3,Blue);</syntaxhighlight> | <syntaxhighlight>Value1 = Text_SetColor(3 ,Blue);</syntaxhighlight> | ||
Assign the RGB color 2138336 (Orange) to the text of a text object with the ID number of 3: | Assign the RGB color 2138336 (Orange) to the text of a text object with the ID number of 3: | ||
<syntaxhighlight>Value1=Text_SetColor(3,2138336);</syntaxhighlight> | <syntaxhighlight>Value1 = Text_SetColor(3, 2138336);</syntaxhighlight> | ||
Assign the legacy color 4 (Green) to the text of a text object with the ID number of 3: | Assign the legacy color 4 (Green) to the text of a text object with the ID number of 3: | ||
<syntaxhighlight>[LegacyColorValue=True]; | <syntaxhighlight>[LegacyColorValue = True]; | ||
Value1=Text_SetColor(3,4);</syntaxhighlight> | |||
Value1 = Text_SetColor(3, 4);</syntaxhighlight> | |||
[[Category:Text Drawing]] | [[Category:Text Drawing]] |
Latest revision as of 12:42, 13 February 2012
Assigns the specified color to the text of a text object with the specified ID number.
Text_SetColor returns a value of 0 if the color was successfully assigned, and a value of -2 if the specified object ID number is invalid.
Usage
Text_SetColor(ObjectID, TextColor)
Parameters
- ObjectID - a numerical expression specifying the object ID number.
- TextColor - an expression specifying the text color.
- The color can be specified by a numerical expression representing an RGB color number or a legacy color value, or by one of 17 base color words.
Notes
- An object-specific ID number is returned by Text_New when the text object is created.
- Use Text_GetColor to get the color of a specific text object.
Examples
Assign the color blue to the text of a text object with the ID number of 3:
Value1 = Text_SetColor(3 ,Blue);
Assign the RGB color 2138336 (Orange) to the text of a text object with the ID number of 3:
Value1 = Text_SetColor(3, 2138336);
Assign the legacy color 4 (Green) to the text of a text object with the ID number of 3:
[LegacyColorValue = True];
Value1 = Text_SetColor(3, 4);