• Specifying a set of colors that an application requires. The palette is selected into a shell window before any drawing occurs, to ensure that its colors are available for later drawing requests. A shell window has exactly one palette associated with it. This palette is called the selected palette. When drawing is done in a window, the foreground and background values in the CgGC are used as indices into the selected palette.Defines a pixel-value-to-color mapping as an array of colors, indexed by 0-based pixel values. There is no restriction on the size of the palette (sizes of 2, 16, and 256 are often encountered in standard image formats). Colors are undefined for pixel values not in the palette. A drawable can select a CgIndexedPalette but not a CgDirectPalette.Defines a pixel-value-to-color mapping that encodes colors directly in pixel values. The palette specifies which bits in a pixel value correspond to each of the RGB primaries. Only the specified bits are used when doing conversions; other bits in a pixel value are ignored. A CgDirectPalette cannot be selected in a drawable. It is used only to specify the pixel-value-to-color mapping of images using direct pixel values. The following sections describe ways of selecting a CgDirectPalette, in order to display images using direct pixel values.
|