Important: The information in this document is obsolete and should not be used for new development.
About the Color Manager
The Color Manager is optimized to work with graphics hardware that contains a color lookup table (CLUT), a data structure that maps the index values into actual colors. Color QuickDraw supports two kinds of devices:
Color QuickDraw uses the Color Manager to determine which entry in a device's CLUT best maps to a color. When your application uses the
- Indexed devices, which contain hardware that converts a pixel value stored in the card's video RAM to some actual color. The pixel value can be an index to any of the colors in the CLUT for the device, and for most CLUTs the set of colors can be changed.
- Direct devices, which display the RGB color values stored in the card's video RAM. Unlike indexed devices, values placed in the frame buffer of direct devices produce the same color every time.
RGBForeColor
orRGBBackColor
function to set a color as the foreground or background color, Color QuickDraw calls on the Color Manager to find the color in the CLUT of the current graphics device that maps most closely to the color you submitted. The Color Manager returns the index to the best color, and Color QuickDraw puts the value in thefgColor
field of your application'sCGrafPort
data structure.
The sections that follow describe how the Color Manager selects from colors available on the CLUT to satisfy color requests.
- Note
- QuickDraw and the Palette Manager also use Color Manager functions to change the entries in a device's CLUT. Applications that do color painting and animation need to control the precise colors they use; they should use the Palette Manager to allocate colors. Palette Manager functions operate transparently across multiple screens, but Color Manager functions do not.
Subtopics
- Graphics Devices
- Color Tables
- Inverse Tables