XSetRGBColormaps()XSetRGBColormaps()NameXSetRGBColormaps – set an XStandardColormap structure.
Synopsis
void XSetRGBColormaps(display, w, std_colormap, count, property)
Display *display;
Window w;
XStandardColormap *std_colormap;
int count;
Atom property;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
w Specifies the window.
std_colormap
Specifies the XStandardColormap structure to be used.
count Specifies the number of colormaps.
property Specifies the property name.
Availability
Release 4 and later.
DescriptionXSetRGBColormaps() replaces the RGB colormap definition in the speci‐
fied property on the named window. If the property does not already
exist, XSetRGBColormaps() sets the RGB colormap definition in the spec‐
ified property on the window. The property is stored with a type of
RGB_COLOR_MAP and a format of 32. Note that it is the caller's respon‐
sibility to honor the ICCCM restriction that only RGB_DEFAULT_MAP con‐
tain more than one definition.
To create a standard colormap, follow this procedure:
1. Open a new connection to the same server.
2. Grab the server.
3. See if property is on the property list of the root window for the
display, using XGetStandardColormap(). If so, see if the colormap
field is non-zero. If it is, the colormap already exists.
4. If the desired property is not present, do the following:
· Determine the color capabilities of the display. Choose a vis‐
ual.
· Create a colormap (not required for XA_RGB_DEFAULT_MAP).
· Call XAllocColorPlanes() or XAllocColorCells() to allocate
cells in the colormap.
· Call XStoreColors() to store appropriate color values in the
colormap.
· Fill in the descriptive fields in the structure.
· Call XSetRGBColormaps() to set the property on the root window.
· Use XSetCloseDownMode() to make the resource permanent.
· Close the new connection to the server.
5. Ungrab the server.
6. XSetRGBColormaps() supersedes XSetStandardColormap().
For more information, see Volume One, Chapter 7, Color.
Structures
typedef struct {
Colormap colormap;
unsigned long red_max;
unsigned long red_mult;
unsigned long green_max;
unsigned long green_mult;
unsigned long blue_max;
unsigned long blue_mult;
unsigned long base_pixel;
VisualID visualid; /* added by ICCCM version 1 */
XID killid; /* added by ICCCM version 1 */
} XStandardColormap;
Errors
BadAlloc
BadAtom
BadWindow
See AlsoXAllocStandardColormap(), XGetRGBColormaps(), XVisualIDFromVisual().
Xlib - Window Manager Hints XSetRGBColormaps()