PEXUtCreateWriteableColormap(3G)
Name
PEXUtCreateWriteableColormap − create a Colormap and initialize it for standard PEX color approximation
Syntax
#include <pexutcmap.h>
int PEXUtCreateWriteableColormap(Display *display, XVisualInfo *vis_info, PEXColorApproxEntry *capx_info, Colormap *colormap_id_return)
Parameters
display
A pointer to a display structure returned by a successful XOpenDisplay call, on which PEXlib has been initialized.
vis_info
A pointer to a valid structure that describes the Visual in which the Colormap will be created.
capx_info
A pointer to a valid structure, that describes the color approximation setup for which the Colormap is to be initialized.
colormap_id_return
A pointer to a identifier, into which will be written the resource ID of the created Colormap.
Returns
The function returns a value of if the Colormap is successfully created and initialized.
A negative return value indicates failure. The following are the meanings of the different failure values:
•A return value of means that an error was encountered during an Xlib call, including X Colormap creation.
•means that the utility ran out of memory.
Description
This procedure creates an X Colormap in the Visual described by vis_info. It uses the provided PEX color approximation table entry (in capx_info) as a guide in initializing the Colormap contents. All cells in the Colormap are allocated read/write for this client, but only the cells in the region of the Colormap described by the color approximation entry have been modified from their default values. An application that plans to share the colormap or use XAllocColor may need to free the cells outside the region (see PEXUtCopyColormapAsReadOnly).
If successful, the new Colormap ID is returned in colormap_id_return. The new Colormap ID is not entered into any standard colormap property.
Restrictions
Some PEX implementations may support some configurations in which additional Colormap initialization is needed. It is recommended that PEXUtModifyColormapForVendorDependencies be called after this function, in order to make these modifications.
See Also
(c) Hewlett-Packard Company — HP PEXlib Release 5.1: January 1993