In the Indexed color model, you have control over how colors are loaded into a color lookup table. You do this by specifying a palette, which maps color index values into RGB values, for the destination object. When the contents of your destination object are rendered on the physical device (that is, when you call the Draw method for the destination object), the RGB values from the palette are either:
Specify that a destination object should use the Indexed color model by setting the COLOR_MODEL property of the object equal to 1 (one):
myWindow = OBJ_NEW('IDLgrWindow', COLOR_MODEL = 1)
Specify a palette object by setting the PALETTE property equal to an object of the IDLgrPalette class:
If you do not specify a palette object for a destination object that uses the Indexed color model, a grayscale ramp palette is loaded automatically.
When you assign a color index to an object that is drawn on the destination device, the color index is used to look up an RGB value in the specified palette. When you assign an RGB value to an object that is drawn on the destination device, the nearest match within the destination object's palette is found and used to represent that color.