Color specification formats

Color specification formats

It is possible to use named colors and other color specification formats in place of color index values when setting various types of color resources. There are four different types of resources for setting single or arrays of color values: NhlTColorIndex, NhlTColorIndexGenArray, NhlTColorMap, and NhlTColorDefinitionGenArray. Setting color values for each of these types of resources is covered below.

For complete examples showing how to use named colors, see the Quick Start Guide examples cn05, cn14, cn17, xy07, and xy16.

Important notes about color specification formats

In the second workstation, the text should be red instead of blue, because in the second color map, red is occupying the same location in the color map that blue occupied for the first color map. To get around this problem, you need to make sure that named colors occupy the same locations in the color maps, or else you have to call setvalues on text and set txFontColor to "blue" again.

Tables of named colors

To see the valid 650 named colors, see the ASCII file $NCARG_ROOT/lib/ncarg/database/rgb.txt or click on any one of the 15 tables below to see the color names and their associated colors:

MIT copyright

        Copyright    Massachusetts Institute of Technology    1985

Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of M.I.T. not be used in
advertising or publicity pertaining to distribution of the software
without specific, written prior permission.  M.I.T. makes no
representations about the suitability of this software for any
purpose.  It is provided "as is" without express or implied warranty.

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?

$Revision: 1.4 $ $Date: 1999/04/28 16:42:06 $