Restoring the Color Environment
Restoring the Color Environment
When a window closes, the Palette Manager resets each display device to
its default color table, except for those indices still reserved by an other
application. Eventually, the application that owns those indices will terminate
or voluntarily release the indices. You can run a long sequence of
color-stealing, wildly animated programs, quit them all, return to the Finder,
and find every screen in the system fully restocked with default system color
tables. (But if an application calls the Color Manager
procedure ProtectEntry to lock a device index, the Palette Manager
cannot restore the default color tables.)
The Palette Manager re stores an animated entry to a default color state
when the index is no longer needed.
The Palette Manager provides default color tables for differing screen
devices.
Screen device Default color table
Any device in black-and-white A gray-scale ramp, that is, an evenly
spaced range mode or 1 bit deep from
white in index 0 to black in the last index.
A color device in 2-bit mode Indices 0 to 3 contain white, 50 percent
gray, the highlight color, and black,
respectively.
A color device in 4-bit mode The resource 'clut' with a resource ID of
4. If the color closest to the highlight color
differs from it by more than 0x3000 in
any component, the color is averaged with
the highlight color.
A color device in 8-bit mode The resource 'clut' with resource ID 8.
The 'clut' resource IDs 1, 2, 4, and 8 are the standard color tables for those
bit depths. The 'clut' resource IDs 34, 36, and 40-the bit depth plus 32-are
gray-scale ramps for those bit depths. The default color tables with the
highlight color added are 'clut' resource IDs 66, 68, and 72-that is, the bit
depth plus 64. To get these color tables, use the GetCTable function (not
GetResource), as described in Color QuickDraw.