Objects of the IDLgrPalette class are used to create color lookup tables. Color lookup tables assign individual numerical values to color values; this allows you to specify the color of a graphic object with a single number (a color index) rather than explicitly providing the red, green, and blue color values (an RGB triple). Palettes are most useful when you want data values to correspond to color values-that is, if you want a data value of 200, for example, to always correspond to a single color. This correspondence is one of the main uses of the Indexed Color Model. See the "Working with Color" chapter of the Image Processing in IDL manual for additional discussion of indexed color and its uses.
Specify three vectors representing the red, green, and blue values for the palette when you call the IDLgrPalette::Init method. The values in the red, green, and blue vectors must be integers between zero and 255, and the length of each vector must not exceed 256 elements. For example, the following statements create a palette object that reverses a standard grayscale ramp palette:
rval = (gval = (bval = REVERSE(INDGEN(256)))) myPalette = OBJ_NEW('IDLgrPalette', rval, gval, bval)
See IDLgrPalette for details on creating palette objects.
Palettes can be associated either with graphics destination objects (windows or printers) or with individual graphic atoms: