hpux man page for xcreatecolormap

Query: xcreatecolormap

OS: hpux

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

XCreateColormap()														 XCreateColormap()

Name
  XCreateColormap - create a colormap.

Synopsis
  Colormap XCreateColormap(display, w, visual, alloc)
	Display *display;
	Window w;
	Visual *visual;
	int alloc;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  w	    Specifies a window ID.  The colormap created will be associated with the same screen as the window.

  visual    Specifies a pointer to the Visual structure for the colormap.  The visual class and depth must be supported by the screen.

  alloc     Specifies how many colormap entries to allocate.  Pass either AllocNone or AllocAll.

Returns
  The created colormap.

Description
  XCreateColormap() creates a colormap of the specified visual type and allocates either none or all of its entries, and returns the colormap
  ID.

  It is legal to specify any visual class in the structure pointed to by the visual argument.  If the class is	StaticColor,  StaticGray,  or
  TrueColor,  the  colorcells  will have pre-allocated read-only values defined by the individual server but unspecified by the X11 protocol.
  In these cases, alloc must be specified as AllocNone (else a BadMatch error).

  For the other visual classes, PseudoColor, DirectColor, and GrayScale, you can pass either AllocAll or AllocNone to the alloc argument.  If
  you  pass AllocNone, the colormap has no allocated entries.  This allows your client programs to allocate read-only colorcells with XAlloc-
  Color or read/write cells with XAllocColorCells(), AllocColorPlanes and XStoreColors().  If you pass the constant AllocAll, the entire col-
  ormap is allocated writable (all the entries are read/write, nonshareable and have undefined initial RGB values), and the colors can be set
  with XStoreColors().	However, you cannot free these entries with XFreeColors(), and no relationships between the entries are defined.

  If the visual class is PseudoColor or GrayScale and alloc is AllocAll, this function simulates a call to the function  XAllocColor()	cells
  returning all pixel values from 1 to (map_entries - 1).  For a visual class of DirectColor, the processing for AllocAll simulates a call to
  the function XAllocColorPlanes(), returning a pixel value of 0 and mask values the same as the red_mask, green_mask, and blue_mask  members
  in visual.

  The visual argument should be as returned from the DefaultVisual macro, XMatchVisualInfo(), or XGetVisualInfo().

  If the hardware colormap on the server is immutable, and therefore there is no possibility that a virtual colormap could ever be installed,
  XCreateColormap() returns the default colormap.  Code should check the returned ID against the default colormap to catch this situation.

  For more information on creating colormaps, see Volume One, Chapter 7, Color.

Errors
  BadAlloc

  BadMatch  Didn't use AllocNone for StaticColor, StaticGray, or TrueColor.
	    visual type not supported on screen.

  BadValue

  BadWindow

See Also
  XDefaultColormap(), XDisplayCells(), XCopyColormapAndFree(), XFreeColormap(), XGetStandardColormap(),  XInstallColormap(),  XListInstalled-
  Colormaps(), XSetStandardColormap(), XSetWindowColormap(), XUninstallColormap().

Xlib - Colormaps														 XCreateColormap()
Related Man Pages
xfreecolormap(3) - debian
xcolor(3) - centos
xcolor(3x11) - osf1
xcopycolormapandfree(3x11) - osf1
xfreecolormap(3x11) - osf1
Similar Topics in the Unix Linux Community
Xlib registering