XFreeColormap(display, colormap)
      Display *display;
      Colormap colormap;


display Specifies the connection to the X server.
colormap Specifies the colormap that you want to destroy.


The XFreeColormap() function deletes the association between the colormap resource ID and the colormap and frees the colormap storage. However, this function has no effect on the default colormap for a screen. If the specified colormap is an installed map for a screen, it is uninstalled (see XUninstallColormap()). If the specified colormap is defined as the colormap for a window (by XCreateWindow(), XSetWindowColormap(), or XChangeWindowAttributes()), XFreeColormap() changes the colormap associated with the window to None and generates a ColormapNotify event. X does not define the colors displayed for a window with a colormap of None .

XFreeColormap() can generate a BadColor error.


BadColor A value for a Colormap argument does not name a defined Colormap.

See also

XAllocColor(), XChangeWindowAttributes(), XCopyColormapAndFree(), XCreateColormap(), XCreateWindow(), XQueryColor(), XStoreColors(), "Creating, Copying, and Destroying Colormaps".
Christophe Tronche, ch@tronche.com