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_name.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 chips_color_name Context: chips

Synopsis

Converts a color number to a string.

Syntax

String_Type chips_color_name([colorValue])

Description

Returns the string equivalent of the symbolic color values in the "_chips" namespace. The values are described in the 'Attribute values' section of "ahelp chips". The "chips_color_value()" function can be used to convert the names of colors to their symbolic value.

Arguments for chips_color_name

Name Type Options Default Comment
colorValue Integer_Type black, blue, cyan, default, green, magenta, red, white, yellow (see Example 3) default Optional

If colorValue is outside the range of supported colors, then the string "default" will be returned. If the color value is omitted the routine will return a string containing all the available colors, separated by a newline (i.e. '\n') character.

Example 1

  chips> chips_color_name( _chips->red )
  red
	

Here we convert the value _chips->red to the string "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> variable colname = chips_color_name( chips.curvecolor );
  chips> print("The color of curves is " + colname );
	

Here use use S-Lang code to find out the name of the color used to draw curves. If the ChIPS state object has not been changed, then these commands would produce the following output:

  The color of curves is default
	

Example 3

  chips> chips_color_name()
  black
  blue
  cyan
  default
  green
  magenta
  red
  white
  yellow
	

Since no value is given, the list of available colors is returned. This string may be stored in a variable:

  chips> hues = chips_color_name()
  chips> print(hues)   
  black
  blue
  cyan
  default
  green
  magenta
  red
  white
  yellow
	

As the names are separated by the newline ('\n') character, they can be easily separated using the S-Lang strchop() function:

  chips> colors = strchop( chips_color_name(), '\n', 0 )
  chips> print(colors[2])
  cyan
	

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.