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
ColorInfostructures 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
ColorInfostructure in the palette.srcTolerance- The tolerance value to be assigned each
ColorInfostructure in the palette.DISCUSSION
TheNewPalettefunction fills the palette with as many RGB values from the color table as it has or can fit.NewPalettesets theusagefield of each color to the value in thesrcUsageparameter and the tolerance value of each color to the value in thesrcToleranceparameter. 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 theNewPalettefunction 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
SetPalettefunction (page 1-11).To change the entries in a palette after creating it, use the
SetEntryColorfunction (page 1-28) and theSetEntryUsagefunction (page 1-29).