Important: The information in this document is obsolete and should not be used for new development.
ColorTable
When creating aPixMap
record (described on page 4-37) for a particular graphics device, Color QuickDraw creates aColorTable
record that defines the best colors available for the pixel image on that particular graphics device. The Color Manager also creates aColorTable
record of all available colors for use by the CLUT on indexed devices.Typically, your application needs to create
ColorTable
records only if it uses the Palette Manager, as described in the chapter "Palette Manager" in Inside Macintosh: Advanced Color Imaging. The data structure of typeColorTable
is shown here.
TYPE CTabHandle =\xF0^CTabPtr; CTabPtr =\xF0^ColorTable; ColorTable =\xF0 RECORD ctSeed: LongInt; {unique identifier from table} ctFlags: Integer; {flags describing the value in the } { ctTable field; clear for a pixel map} ctSize:\xF0 Integer; {number\xF0of\xF0entries\xF0in\xF0the next field } { minus 1} ctTable: cSpecArray; {an array of ColorSpec records} END;Your application should never need to directly change the fields of a
Field Description
ctSeed
- Identifies a particular instance of a color table. The Color Manager uses the
ctSeed
value to compare an indexed device's color table with its associated inverse table (a table it uses for fast color lookup). When the color table for a graphics device has been changed, the Color Manager needs to rebuild the inverse table. See the chapter "Color Manager" in Advanced Color Imaging on the Mac OS for more information on inverse tables.ctFlags
- Flags that distinguish pixel map color tables from color tables in
GDevice
records (which are described in the chapter "Graphics Devices" in this book).ctSize
- One less than the number of entries in the table.
ctTable
- An array of
ColorSpec
entries, each containing a pixel value and a color specified by anRGBColor
record, as described in the previous section.ColorTable
record. If you find it absolutely necessary for your application to so, immediately use theCTabChanged
procedure to notify Color QuickDraw that your application has changed theColorTable
record. TheCTabChanged
procedure is described on page 4-88.