Name
SetLayerPalette -- change layer palette (V9.0)
Synopsis
SetLayerPalette(id, palid[, t])
Function
This function replaces the palette of the layer 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:

Remap:
If this is set to True, the pixels of the layer 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 layer 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.

Dither:
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.

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

You need to enable layers before you can use this function. See Layers introduction for details.

Inputs
id
identifier of layer to use
palid
identifier of palette to copy to layer
t
optional: table for specifying further options (see above)

Show TOC