Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging on the Mac OS /
Chapter 1 - Palette Manager / Using the Palette Manager


Drawing With a Palette's Colors

You can use the PmForeColor and PmBackColor functions to specify foreground and background drawing using colors from your palette. The functions set the foreground and background colors of the current graphics port to the palette colors you specify so that subsequent drawing operations use them. (In effect, you substitute these functions for the Color QuickDraw functions RGBForeColor and RGBBackColor. Use the RGBForeColor and RGBBackColor functions to specify drawing with colors not contained in your palette.)

For courteous and tolerant entries, PmForeColor calls the RGBForeColor function using the RGB color of the palette entry. For animated colors, PmForeColor selects the recorded device index previously reserved for animation (if still present) and installs it in the color graphics port. The RGB foreground color field is set to the value from the palette entry. For explicit colors, PmForeColor places the value

dstEntry modulo (maxIndex +1)

into the color graphics port, where maxIndex is the largest index available in a device's color table. When multiple devices with different depths are present, the value of maxIndex varies appropriately for each device.

You can save and restore the current foreground and background colors by using the SaveFore, RestoreFore, SaveBack, and RestoreBack functions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996