SetLayerDepth(id, depth[, t])
id
to the depth specified in depth
.
depth
must be a bit depth ranging from 1 (= 2 colors) to 8 (= 256 colors). See Palette overview for details.
Note that if the specified depth is less than that of the pixel data attached to the palette, the
pixel data will be remapped to match the new depth.
The following tags are supported by the optional table argument t
:
Frame:
Remap:
False
, out-of-range pens will not be remapped to existing pens
but instead they will simply be set to the pen specified in the ClipPen
tag (see below),
i.e. no remapping will take place. Note that Remap
is only effective when reducing colors. If
the new depth has more pens than the old depth, Remap
won't do anything. (V10.0)
ClipPen:
Remap
tag is set to False
(see above). In that case,
out-of-range pens will not be remapped to existing pens but will simply be set to the
pen specified in the ClipPen
tag, i.e. no remapping will take place. Note that ClipPen
is only effective when reducing colors. If the new depth has more pens than the old depth,
ClipPen
won't do anything. (V10.0)
You need to enable layers before you can use this function. See Layers introduction for details.
SetLayerDepth(1, 8)The code above changes the depth of layer 1's palette to 8 (= 256 colors).