About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/chips_color_value.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 chips_color_value Context: chips

Synopsis

Converts the name of a color to its numeric value.

Syntax

Integer_Type chips_color_value(colorName)

Description

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

Name Type Default Comment
colorName String_Type 3 Case insensitive

The value of _chips->default will be returned when an unknown color is specified.

Example 1

  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").

Example 2

  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.

Example 3

  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.

Example 4

  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;
	

Bugs

See the bugs page for ChIPS on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.