NhlSetColor

The Fortran name of this function is NhlFSetColor.

This function sets the RGB color value for a specified HLU color index.


C Synopsis

#include <ncarg/hlu/hlu.h>
#include <hfile for Workstation class object>

NhlErrorTypes NhlSetColor(
	        int	workid,
		int	ci,
		float	red,
		float	green,
		float	blue
		)

Fortran Synopsis

      subroutine NhlFSetColor(workid, ci, red, green, blue, ierr)
      integer workid, ci, ierr
      real red, green blue

Arguments

workid (input)
Integer identifier of an instance of a Workstation class object
ci (input)
Integer color index in the range 1 through 255 that is to be allocated.
red (input)
Value of the red component of the desired color in the range 0.0 to 1.0 inclusive.
green (input)
Value of the green component of the desired color in the range 0.0 to 1.0 inclusive.
blue (input)
Value of the blue component of the desired color in the range 0.0 to 1.0 inclusive.
ierr (output, Fortran only)
Error code.

Types

Type name:		NhlTErrorTypes
Definition:
typedef enum _NhlErrType{
	NhlFATAL	= -4,	/* "FATAL"	*/
	NhlWARNING	= -3,	/* "WARNING"	*/
	NhlINFO		= -2,	/* "INFO"	*/
	NhlNOERROR	= -1	/* "NOERROR"	*/
} NhlErrorTypes;

Description

Use this function to allocate a specific HLU color index or redefine the color of a previously allocated index. The index must be in the range 1 through 255. Note that the HLU library does not require that allocated color indexes be contiguous. Thus, for example, using NhlSetColor you could allocated indexes 10, 100, and 200 without allocating any of the indexes in between. If you set the color of some feature in a plot object using an unallocated color index, the Workstation will using the color assigned to the foreground color (HLU color index 1, NhlFOREGROUND).

Return Values

The NhlSetColor C function returns a value of type NhlErrorTypes, and the NhlFSetColor Fortran subroutine returns the error in ierr. The following table indicates what the various return Error Values mean:
Value	|			Meaning
--------+-------------------------------------------------
NOERROR	|	function successful
--------+-------------------------------------------------
INFO	|	minor recoverable error
--------+-------------------------------------------------
WARNING	|	recoverable error
--------+-------------------------------------------------
FATAL	|	function failed; continuing the program
	|       may result in core dump


See Also


Copyright

Copyright 1987-1999 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

NCAR Graphics is a registered trademark of the University Corporation for Atmospheric Research.

Reference Manual Control Panel

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


$Revision: 1.10 $ $Date: 1998/06/15 21:26:31 $