Name
CopyPens -- copy pens from one palette to another (V9.0)
Synopsis
CopyPens(srcid, dstid, srcidx, n[, dstidx])
Library
palette

Function
This function will copy n pens from the palette specified by srcid to the palette specified by dstid. The pens will be read from index srcidx in the source palette and they will be copied to the index dstidx in the destination palette. If dstidx is omitted, the index specified in srcidx will be used as the destination index.

Note that it is allowed to use the same palette identifier for srcid and dstid. In that case, pens inside a single palette object can be moved around. Overlapping pens are also supported.

Inputs
srcid
source palette
dstid
destination palette; can be the same as the source
srcidx
index of the first pen to be copied (starts from 0)
n
number of pens to copy
dstidx
optional: index to copy pens to in the destination palette; defaults to srcidx
Example
CopyPens(1, 2, 0, 32)
The code above copies the first 32 pens from palette 1 to palette 2.

Show TOC