Important: The information in this document is obsolete and should not be used for new development.
ColorTable
When creating aPixMaprecord (described on page 4-37) for a particular graphics device, Color QuickDraw creates aColorTablerecord that defines the best colors available for the pixel image on that particular graphics device. The Color Manager also creates aColorTablerecord of all available colors for use by the CLUT on indexed devices.Typically, your application needs to create
ColorTablerecords only if it uses the Palette Manager, as described in the chapter "Palette Manager" in Inside Macintosh: Advanced Color Imaging. The data structure of typeColorTableis 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
ctSeedvalue 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
GDevicerecords (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
ColorSpecentries, each containing a pixel value and a color specified by anRGBColorrecord, as described in the previous section.ColorTablerecord. If you find it absolutely necessary for your application to so, immediately use theCTabChangedprocedure to notify Color QuickDraw that your application has changed theColorTablerecord. TheCTabChangedprocedure is described on page 4-88.