Converts the name of a color to its numeric value.
Integer_Type chips_color_value(colorName)
Returns the symbolic value for the supplied color name.
The color values are described in the
'Attribute values' section of "ahelp chips".
The "chips_color_name()" function can be used to
convert the symbolic value back to the name of a color.
Arguments for chips_color_value
colorName |
String_Type |
3 |
Case insensitive |
The value of _chips->default will be
returned when an unknown color is specified.
chips> chips_color_value( "red" )
6
chips> _chips->red
6
Here we find the symbolic value for the color "red".
Since we have ignored the return value
ChIPS prints it out to the screen (see the
'Using ChIPS and Sherpa as a calculator' section
of "ahelp tips").
chips> chips_color_value( "green" )
4
chips> chips_color_value( "GREEN" )
4
chips> chips_color_value( "GrEEn" )
4
The case of the color name is unimportant,
as shown here.
chips> chips_color_value( "UnknownColor" )
3
chips> chips_color_value( "default" )
3
If a color is unknown, then the value for the
default color is returned.
chips> chips.curvecolor = chips_color_value( "red" );
Here we set the curvecolor attribute of the
ChIPS state object (see "ahelp
chips") to be red. Since curvecolor must be specified using
the symbolic value for the color red, we use
chips_color_value() to do the conversion.
The following line of code can also be used
to set the curvecolor attribute to red:
chips> chips.curvecolor = _chips->red;
- chips
-
chips_auto_redraw,
chips_clear,
chips_color_name,
chips_get_pane,
chips_get_xrange,
chips_get_xscale,
chips_get_yrange,
chips_get_yscale,
chips_get_zrange,
chips_get_zscale,
chips_label,
chips_line,
chips_pickpoints,
chips_redraw,
chips_set_pane,
chips_set_xrange,
chips_set_xscale,
chips_set_yrange,
chips_set_yscale,
chips_set_zrange,
chips_set_zscale,
chips_split,
chips_version
|