Language > Objects > Creating an Object Graphics Display > Color in Object Graphics

# Color in Object Graphics

Color in an Object Graphics display is the result of interaction between the color model defined for the destination object (e.g. window or printer), the destination object’s inherent color model, and the color assigned to any visualization objects (e.g. plot, text or image objects) being displayed. This section explains how to specify color when using Object Graphics and how IDL interacts with the destination devices on which graphics are finally displayed.

Object Graphics supports two color models for newly created destination objects (such as an IDLgrWindow): an Indexed Color Model and an RGB Color Model. Indexed color allows you to map data values to color values using a color palette. RGB color allows you to specify color values explicitly, using an RGB triple. See Indexed Color Model and RGB Color Model in Object Graphics.

Note: For some X11 display situations, IDL may not be able to support a color index model destination object in object graphics. We do, however, guarantee that an RGB color model destination will be available for all display situations.

The devices on which graphics are rendered—computer displays, printers, plotters, frame buffers, etc.—also support one or more color models. IDL performs any conversions necessary to support either the Indexed or RGB color model on any physical device. That is, the color model used by IDL is entirely independent of the color model used by the physical device. How IDL Interprets Color Values explains how IDL’s Object System color models interact with different device color models.

Note: You can specify the color of any graphic object using either a color index or red, green, and blue (RGB) value, regardless of the color model used by the destination object or the physical destination device. See Specifying Object Color for details.

The majority of graphic visualization objects have a COLOR property that can be set to an indexed value or an RGB triple. You can set the color of any visualization object when it is first created and later change it using this property. In addition to the COLOR property, you can also associate a palette object (an instance of the IDLgrPalette class) with many visualization objects using the PALETTE property.

One exception is the IDLgrImage object, which does not have a COLOR property. Instead, you use the PALETTE property to specify a related color table for an indexed image, or set the INTERLEAVE property to define the arrangement of the image channels in a RGB image. Palette objects can also be associated with destination objects. See Palette Objects for more information.