Color Usage Categories
window's palette, if it has one, to determine whether colors need to be loaded
into the current device's color look-up tables. If your window requires 180
shades of green, for example, chances are the current CLUTs lack the
depends on what colors are in it already, what colors you ask for, and the
categories into which your colors fall.
specify to control the way the Palette Manager allocates colors. You assign usage categories to colors when you create your palette, and you can change the
determines to be the closest match currently available in the color
already in the CLUT. On direct devices, courteous colors always
display as specified. Courteous colors have no special properties,
but their use offers you a convenient holding place for collecting
colors.
indexed device, but, unlike a courteous color, a tolerant color
specifies an acceptable range for color matching. If no color in the
matches tolerant colors as closely as the hardware allows.
• An animated color is used for special color animation effects, as palette until its window is closed, and until then their spaces are
unavailable to (and cannot be used to match) any other request for
color. The effects of color animation depend on the existence of a
device color table, and, since a direct device does not have one, color
animation has no effect on a direct device's display. If your window
spans two devices, one indexed and one direct, the
the indexed device's screen.
• An explicit color specifies an index value, and always generates the corresponding entry from the device's color table. Explicit
colors are useful if you wish to display the contents of a color
table-for example, to display to a user some or all of the colors
actually available.
• An inhibited color is pr evented from appearing on color and gray-scale devices of specified pixel depths. Inhibited colors are
always combined with other usage categories. You can create a large
palette-for example, with two different sets of color ranges, one
optimized for a 4-bit device, the other optimized for an 8-bit
device-and then inhibit colors on the devices for which they are not
intended.
• PmWhite and pmBlack colors are assigned to white or black on
1-bit devices. If your application is working with red and dark blue,
for example, both might get mapped to black on a 1-bit device. By
assigning pmWhite to one and pmBlack to the other, you assure that they will be distinct. These categories may be combined with other
usage categories, but combining them with each other is un defined.
Several color usage categories can be combined. You can specify that a color is
both tolerant and explicit, for example, which means that your RGB color, or a
tolerably close match, is placed in the color table at the index corresponding to
that palette entry (as opposed to merely being available somewhere in the
table), on all devices that touch the window.
When you specify colors for a palette within a 'pltt' resource, you usually
assign the same usage value to each color in the palette. However, if you must
use a particular color differently than the others, you can assign it a different
usage value, either when creating the resource file, or within the application