XInstallColormap()XInstallColormap()NameXInstallColormap – install a colormap.
Synopsis
XInstallColormap(display, colormap_return)
Display *display;
Colormap colormap_return;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
colormap_return
Specifies the colormap to install.
DescriptionXInstallColormap() installs a virtual colormap into a hardware col‐
ormap. If there is only one hardware colormap, XInstallColormap()
loads a virtual colormap into the hardware colormap. All windows asso‐
ciated with this colormap immediately display with their chosen colors.
Other windows associated with the old colormap will display with false
colors. If additional hardware colormaps are possible, XInstallCol‐
ormap() loads the new hardware map and keeps the existing ones. Other
windows will then remain in their true colors unless the limit for col‐
ormaps has been reached. If the maximum number of allowed hardware
colormaps is already installed, an old colormap is swapped out. The
MinCmapsOfScreen(screen) and MaxCmapsOfScreen(screen) macros can be
used to determine how many hardware colormaps are supported.
If colormap_return is not already an installed map, a ColormapNotify
event is generated on every window having colormap_return as an
attribute. If a colormap is uninstalled as a result of the install, a
ColormapNotify event is generated on every window having that colormap
as an attribute.
Colormaps are usually installed and uninstalled by the window manager,
not by clients. At any time, there is a subset of the installed col‐
ormaps, viewed as an ordered list, called the "required list." The
length of the required list is at most the min_maps specified for each
screen in the Display structure. When a colormap is installed with
XInstallColormap() it is added to the head of the required list and the
last colormap in the list is removed if necessary to keep the length of
the list at min_maps. When a colormap is uninstalled with XUninstall‐
Colormap() and it is in the required list, it is removed from the list.
No other actions by the server or the client change the required list.
It is important to realize that on all but high-performance worksta‐
tions, min_maps is likely to be 1. If the hardware colormap is
immutable, and therefore installing any colormap is impossible, XIn‐
stallColormap() will work but not do anything.
For more information, see Volume One, Chapter 7, Color.
Errors
BadColor Invalid colormap.
See AlsoXDefaultColormap(), XDisplayCells(), XCopyColormapAndFree(), XCreate‐
Colormap(), XFreeColormap(), XGetStandardColormap(), XListInstalledCol‐
ormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallCol‐
ormap().
Xlib - Colormaps XInstallColormap()