Important: The information in this document is obsolete and should not be used for new development.
CTab2Palette
Copies the colors of a color table into a palette.
pascal void CTab2Palette( CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance);
srcCTab
- A handle to the color table whose colors are to be copied. Color tables are described in the chapter "Color QuickDraw" of Inside Macintosh: Imaging With QuickDraw.
dstPalette
- The palette to receive the colors.
srcUsage
- A usage constant to be assigned the palette entries. Usage constants are described in "Usage Constants" (page 1-3).
srcTolerance
- A tolerance value to be assigned the palette entries.
DISCUSSION
TheCTab2Palette
function copies the fields from an existing color-table structure into an existing palette structure. If the structures are not the same size, thenCTab2Palette
resizes the palette structure to match the number of entries in the color-table structure. If the palette indstPalette
has any entries allocated for animation on any screen device, they are relinquished before the new colors are copied. ThesrcUsage
andsrcTolerance
parameters are the value that you assign to the new colors.If you want to use color-table animation, you can use
AnimateEntry
(page 1-20) andAnimatePalette
(page 1-21) to change the colors in a palette and on corresponding devices. Changes made to a palette byCTab2Palette
don't take effect until the nextActivatePalette
function is performed. If either the color-table handle or the palette handle isnil
,CTab2Palette
does nothing.