Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xlookupcolor(3) [hpux man page]

XLookupColor()															    XLookupColor()

Name
  XLookupColor - get database RGB values and closest hardware-supported RGB values from color name.

Synopsis
  Status XLookupColor(display, colormap, colorname, exact_def_return, screen_def_return)
	Display *display;
	Colormap colormap;
	char *colorname;
	XColor *exact_def_return, *screen_def_return;

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

  colormap    Specifies the colormap.

  colorname   Specifies  a  color  name string (for example "red").  Uppercase or lowercase does not matter.  If the color name is not in the
	      Host Portable Character Encoding, the result is implementation-dependent.

  exact_def_return
	      Returns the exact RGB values for the specified color name from the /usr/lib/X11/rgb database.

  screen_def_return
	      Returns the closest RGB values possible on the hardware.

Returns
  Zero on failure, non-zero on success.

Description
  XLookupColor() looks up RGB values for a color given the colorname string.  It returns both the exact color values and the  closest  values
  possible on tthe screen specified by colormap.

  XLookupColor() returns non-zero if colorname exists in the RGB database or zero if it does not exist.

  To  determine  the  exact RGB values, XLookupColor() uses a database on the X server.  On UNIX, this database is /usr/lib/X11/rgb.  To read
  the colors provided by the database on a UNIX-based system, see /usr/lib/X11/rgb.txt.  The location, name, and contents of  this  file  are
  server-dependent.

  For more information see Volume One, Chapter 7, Color, and Appendix D, The Server-side Color Database, in this volume.

Errors
  BadName   Color name not in database.

  BadColor  Invalid colormap.

Structures
     typedef struct {
	 unsigned long pixel;
	 unsigned short red, green, blue;
	 char flags;	    /* DoRed, DoGreen, DoBlue */
	 char pad;
     } XColor;

See Also
  XBlackPixel(),  XWhitePixel(),  XAllocColor(),  XAllocColorCells(),  XAllocColorPlanes(), XAllocNamedColor(), XFreeColors(), XParseColor(),
  XQueryColor(), XQueryColors(), XStoreColor(), XStoreColors(), XStoreNamedColor().

Xlib - Color Cells														    XLookupColor()

Check Out this Related Man Page

XStoreColors()															    XStoreColors()

Name
  XStoreColors - set or change the RGB values of read/write colorcells to the closest possible hardware colors.

Synopsis
  XStoreColors(display, colormap, color, ncolors)
	Display *display;
	Colormap colormap;
	XColor color[ncolors];
	int ncolors;

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

  colormap
	   Specifies the colormap.

  color    Specifies an array of color definition structures.

  ncolors  Specifies the number of XColor structures in color.

Description
  XStoreColors()  changes  the	RGB  values  of each colormap entry specified by color[].pixel to the closest possible hardware colors.  Each
  pixel value must be a read/write cell and a valid index into colormap.  XStoreColors() changes the red, green, and/or blue color components
  in each cell according to the color[].flags member, which you set by ORing the constants DoRed, DoGreen, and/or DoBlue.  The specified pix-
  els are changed if they are writable by any client, even if one or more pixels generates an error.

  If the colormap is an installed map for its screen, the changes are visible immediately.  For more information, see Volume One, Chapter  7,
  Color.

Structures
     typedef struct {
	 unsigned long pixel;
	 unsigned short red, green, blue;
	 char flags;	/* DoRed, DoGreen, DoBlue */
	 char pad;
     } XColor;

Errors
  BadAccess A specified pixel is unallocated or read-only.

  BadColor  Invalid colormap.

  BadValue  A specified pixel is not a valid entry into colormap.

See Also
  XBlackPixel(),  XWhitePixel(),  XAllocColor(),  XAllocColorCells(), XAllocColorPlanes(), XAllocNamedColor(), XFreeColors(), XLookupColor(),
  XParseColor(), XQueryColor(), XQueryColors(), XStoreColor(), XStoreNamedColor().

Xlib - Color Cells														    XStoreColors()
Man Page