Important: The information in this document is obsolete and should not be used for new development.
NewPalette
Allocates a new palette from colors in the color table.
pascal PaletteHandle NewPalette ( short entries, CTabHandle srcColors, short srcUsage, short srcTolerance);
entries
- The number of
ColorInfo
structures to be created in the new palette.srcColors
- The color table from which the colors are to be obtained.
srcUsage
- The usage value to be assigned each
ColorInfo
structure in the palette.srcTolerance
- The tolerance value to be assigned each
ColorInfo
structure in the palette.DISCUSSION
TheNewPalette
function fills the palette with as many RGB values from the color table as it has or can fit.NewPalette
sets theusage
field of each color to the value in thesrcUsage
parameter and the tolerance value of each color to the value in thesrcTolerance
parameter. If no color table is provided (srcColors
=nil
), then all colors in the palette are set to black (red, green, and blue equal to $0000).SEE ALSO
For an example of using theNewPalette
function to create a palette, see Listing 1-1 (page 1-22) in Advanced Color Imaging on the Mac OS.To attach a palette to a window after creating it, use the
SetPalette
function (page 1-11).To change the entries in a palette after creating it, use the
SetEntryColor
function (page 1-28) and theSetEntryUsage
function (page 1-29).