SetBrushPalette -- change brush palette (V9.0)
SetBrushPalette(id, palid[, t])
This function replaces the palette of the brush specified by id with the palette specified by palid. The optional table argument t allows you to specify some further options. The following tags are currently supported by the optional table argument t:

If this is set to True, the pixels of the brush will be remapped to match the colors of the new palette as closely as possible. By default, there will be no remapping and the actual pixel data of the brush will remain untouched. If you want remapping, set this tag to True but be warned that remapping all pixels will of course take much more time than just setting a new palette without remapping. Defaults to False.

If the Remap tag (see above) has been set to True, you can use the Dither tag to specify whether or not dithering should be used. Defaults to True which means dithering should be used.

Palettes can have a table containing color cycling information. If you set this tag to True, this cycle table will be copied to the brush as well. Defaults to False.

identifier of brush to use
identifier of palette to copy to brush
optional: table for specifying further options (see above)

Show TOC