Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 1 - Palette Manager Reference /
Palette Manager Functions / Manipulating Palette Entries


Modifies the usage category and tolerance values of a palette entry.

pascal void SetEntryUsage(
                          PaletteHandle dstPalette,
                          short dstEntry,
                          short srcUsage,
                          short srcTolerance); 
A handle to the palette to be modified.
The palette entry.
The new usage value; one or more usage constants.
The new tolerance value.
The SetEntryUsage function stores the usage and tolerance values specified by the srcUsage and srcTolerance parameters into the palette entry specified by the dstEntry parameter. SetEntryUsage marks the entry as having changed, but it does not change the color environment. The change occurs upon the next call to ActivatePalette. Modified entries are marked such that the palette is updated even though no update is required by a change in the color environment. If either srcUsage or srcTolerance is set to $FFFF (-1), the entries are not changed.

This function allows you to easily modify a palette created with NewPalette or modified by CTab2Palette. For such palettes the ciUsage and ciTolerance fields of the ColorInfo structure are the same because you can designate only one value for each. You typically call SetEntryUsage after NewPalette or CTab2Palette to adjust and customize your palette.

For an example of using the SetEntryUsage function to change the usage and tolerance of a color in a palette, see Listing 1-3 (page 1-25) in Advanced Color Imaging on the Mac OS.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996