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: Imaging With QuickDraw /
Chapter 4 - Color QuickDraw / Color QuickDraw Reference

The Color Table Resource

You can use a color table resource to define a color table for a pixel pattern or an indexed device. To retrieve a color table stored in a color table resource, use the GetCTable function described on page 4-83. A color table resource is a resource of type 'clut'. All 'clut' resources should be marked purgeable, and they must have resource IDs greater than 128.

This section describes the structure of this resource after it has been compiled by the Rez resource compiler, available from APDA. However, you typically use a high-level tool such as the ResEdit application, also available through APDA, to create 'clut' resources. You can then use the DeRez decompiler to convert your 'clut' resources into Rez input when necessary.

The compiled output format for a 'clut' resource is illustrated in Figure 4-17.

Figure 4-17 Format of a compiled color table ('clut') resource

The compiled version of a 'clut' resource contains the following elements:

There are several default 'clut' resources for Macintosh computers containing 68020 and later processors. There is a default 'clut' resource for each of the standard pixel depths. The resource ID for each is the same as the pixel depth. For example, the default 'clut' resource for screens supporting 8 bits per pixel has a resource ID of 8.

Another default 'clut' resource defines the eight colors available for basic QuickDraw's eight-color system. This 'clut' resource has a resource ID of 127.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996