Colormap XCopyColormapAndFree(display, colormap)
|| Specifies the connection to the X server.
|| Specifies the colormap.
function creates a colormap of the same visual type and for the same screen
as the specified colormap and returns the new colormap ID.
It also moves all of the client's existing allocation from the specified
colormap to the new colormap with their color values intact
and their read-only or writable characteristics intact and frees those entries
in the specified colormap.
Color values in other entries in the new colormap are undefined.
If the specified colormap was created by the client with alloc set to
the new colormap is also created with
all color values for all entries are copied from the specified colormap,
and then all entries in the specified colormap are freed.
If the specified colormap was not created by the client with
the allocations to be moved are all those pixels and planes
that have been allocated by the client using
and that have not been freed since they were allocated.
|| The server failed to allocate the requested
source or server memory.
|| A value for a Colormap argument does not name a
"Creating, Copying, and Destroying Colormaps".
Christophe Tronche, firstname.lastname@example.org