Name
CopyPalette -- clone a palette (V9.0)
Synopsis
[id] = CopyPalette(source, dest)
Function
This function clones the palette specified by source and creates a copy of it as palette dest. The new palette is independent from the old palette so you can free the source palette after it has been cloned.

If you pass Nil as dest, CopyPalette() will return a handle to the new palette to you. Otherwise the new palette will use the identifier specified in dest.

Inputs
source
source palette id
dest
identifier of the palette to be created or Nil for auto id selection
Results
id
optional: handle to the new palette; will only be returned if you specified Nil in dest
Example
CopyPalette(1, 10)
FreePalette(1)
The above code creates a new palette 10 which contains the same color data as palette 1. Then it frees palette 1 because it is no longer needed.

Show TOC