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

This chapter describes how you can use the Palette Manager to ensure that an optimal set of colors is available whenever one of your application's windows is active.

The Palette Manager monitors the color needs of the graphics environment. The Palette Manager can track the combined color and grayscale requirements of your application, other applications, and the Operating System, and it can do so across multiple screens. The primary purpose of the Palette Manager is to ensure that the best set of colors is available for display devices with limited color capabilities.

For example, on a device that can display 16 colors only, an image composed entirely of earth tones will lack all subtlety and richness because the default color lookup table for the device provides a broad set of colors spread across the color spectrum. With the Palette Manager you can create a palette containing a range of 14 earth tones (you must provide black and white as well) and attach it to a window to get the best display possible for your image. This palette can be attached to one particular window and needn't affect the color display of the Finder, of other applications, or of other windows in your application.

You need to read this chapter if your application uses Color QuickDraw's color system, rather than the basic eight-color system supplied with original QuickDraw and you need to control your color environment.

You should be familiar with the material in Inside Macintosh: Imaging With QuickDraw. In particular, you should understand how Color QuickDraw and graphic devices such as video cards display colors and grays on a screen. The chapter "Introduction to QuickDraw" in Inside Macintosh: Imaging With QuickDraw describes the format and uses of color lookup tables, and it introduces both the indexed color system that can display up to 256 colors and the direct color system that can display thousands or millions of colors. In the same book, the chapter "Color QuickDraw" provides details about the color graphics port and the grafVars data structure, which together hold information about the color settings.

Because the Palette Manager uses the Color Manager to coordinate color assignments across multiple graphic devices, most developers don't need to read the Color Manager chapter, which itself operates on single devices only.


Chapter Contents
About the Palette Manager
Palette Format
The Palette Paradigm
Colors in a Palette
Courteous Colors
Tolerant Colors
Animated Colors
Displaying Animated Colors on Direct Devices
Explicit Colors
Inhibited Colors
Combining Color Usage for an Entry
Sequencing the Entries
How the Palette Manager Allocates Colors for Display
How the Palette Manager Restores the Color Environment
Using the Palette Manager
Creating Palettes
Creating a Palette in Code
Creating a Palette in a Resource File
Selecting the Right Color Set
Creating a Palette by Copying and Assigning It to a Window
Designating a Default Palette for Your Application
Drawing With a Palette's Colors
Animating a Window With a Palette
Disposing of a Palette and Restoring the Color Table
Using Palettes With Offscreen Graphics Worlds
Summary of the Palette Manager
Constants
Data Types
Functions
Initializing the Palette Manager
Initializing and Allocating Palettes
Interacting With the Window Manager
Drawing With Color Palettes
Animating Color Tables
Manipulating Palettes and Color Tables
Manipulating Palette Entries

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996