About the Palette Manager and System 7.0
About the Palette Manager and System 7.0
The Palette Manager monitors the color needs of the graphics environment.
The Palette Manager can track the combined color and gray-scale
requirements of the Operating System, your application, and other
applications, and it can do so across multiple screens. You can use the Palette
Manager to ensure that a set of colors is available whenever one of your
application's windows is active.
System software versions 6.0.5 and later, or those using the 32-Bit
QuickDraw system extension, incorporate the revised and expanded Palette
Manager.
You need to read topics from the Palette Manager if your application uses
Color QuickDraw's color system, rather than the eight-color system
supplied with the original QuickDraw, or no color at all.
You should be familiar with the Graphics Overview and
Color QuickDraw.
Your application should use Palette Manager routines if it needs to
set up and maintain collections of colors or grays
manage shared color resources
provide exact colors for displaying images
initiate color table animation
Your application can specify a color as an RGB value, and
Color QuickDraw and the Color Manager determine the closest match
available on the hardware at the time the color is needed. On direct hardware,
the match is virtually exact; on indexed hardware, the match depends both on
the capabilities of the video device and on the color needs of the Operating
System and other applications. By creating a palette of colors for your
application, you ensure that appropriate colors are available when its window
becomes frontmost.
The Palette Manager acts as intermediary between the palettes you create
for your application's windows and the color look-up tables (CLUTs) that
contain the colors an indexed device can display. When your window is opened
or brought to the front, the Palette Manager checks your palette's colors
against those in the color tables of all devices the window touches. The Palette
Manager then loads colors into the color tables as needed, taking into ac count
the sizes of the color tables and the importance you have placed on various
colors in your palette.
You create palettes as resources of type 'pltt'. In the palette resource you
specify the RGB colors your application needs. You can also indicate whether
each color needs to be matched exactly and, if not, how close a match is
required. You can tailor your palettes to different possible video
devices-indicating, for example, that certain colors in the palette should be
used with 4-bit pixel depths, that a different set should be used with 8-bit
pixel depths, and that neither set should be used with gray-scale devices.
Palettes can also be created from color tables.
The Palette Manager can handle different screen depths across multiple
devices. If the user moves your application window so that it overlaps one
gray-scale, one indexed- pixel, and one direct-pixel screen, the Palette
Manager chooses appropriate grays and colors for all three.
The Palette Manager has access to all palettes used by all windows
throughout the system. A set of default color tables for devices of various
depths ensures that the Palette Manager always returns to a known set of
colors when an application terminates, and, when your application begins
executing, it executes in an environment equipped with as broad a range of
colors or grays as the hardware allows.