


XQueryColor(3X11)					    XQueryColor(3X11)
X11R5									X11R5



NAME
  XQueryColor, XQueryColors, XLookupColor, XParseColor - obtain	color values

SYNTAX
  XQueryColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _d_e_f__i_n__o_u_t)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	XColor *_d_e_f__i_n__o_u_t;

  XQueryColors(_d_i_s_p_l_a_y,	_c_o_l_o_r_m_a_p, _d_e_f_s__i_n__o_u_t, _n_c_o_l_o_r_s)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	XColor _d_e_f_s__i_n__o_u_t[];
	int _n_c_o_l_o_r_s;

  Status XLookupColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r__n_a_m_e, _e_x_a_c_t__d_e_f__r_e_t_u_r_n,
  _s_c_r_e_e_n__d_e_f__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	char *_c_o_l_o_r__n_a_m_e;
	XColor *_e_x_a_c_t__d_e_f__r_e_t_u_r_n, *_s_c_r_e_e_n__d_e_f__r_e_t_u_r_n;

  Status XParseColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p,	_s_p_e_c, _e_x_a_c_t__d_e_f__r_e_t_u_r_n)
	  Display *_d_i_s_p_l_a_y;
	  Colormap _c_o_l_o_r_m_a_p;
	  char *_s_p_e_c;
	  XColor *_e_x_a_c_t__d_e_f__r_e_t_u_r_n;

ARGUMENTS

  _c_o_l_o_r_m_a_p  Specifies the colormap.

  _c_o_l_o_r__n_a_m_e
	    Specifies the color	name string (for example, red) whose color
	    definition structure you want returned.

  _d_e_f__i_n__o_u_t
	    Specifies and returns the RGB values for the pixel specified in
	    the	structure.

  _d_e_f_s__i_n__o_u_t
	    Specifies and returns an array of color definition structures for
	    the	pixel specified	in the structure.

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _e_x_a_c_t__d_e_f__r_e_t_u_r_n
	    Returns the	exact RGB values.

  _n_c_o_l_o_r_s   Specifies the number of _X_C_o_l_o_r structures in the color definition
	    array.

  _s_c_r_e_e_n__d_e_f__r_e_t_u_r_n
	    Returns the	closest	RGB values provided by the hardware.

  _s_p_e_c	    Specifies the color	name string; case is ignored.

  _e_x_a_c_t__d_e_f__r_e_t_u_r_n
	    Returns the	exact color value for later use	and sets the _D_o_R_e_d,
	    _D_o_G_r_e_e_n, and _D_o_B_l_u_e	flags.

DESCRIPTION
  The _X_Q_u_e_r_y_C_o_l_o_r function returns the current RGB value for the pixel in the
  _X_C_o_l_o_r structure and sets the	_D_o_R_e_d, _D_o_G_r_e_e_n,	and _D_o_B_l_u_e flags.  The
  _X_Q_u_e_r_y_C_o_l_o_r_s function	returns	the RGB	value for each pixel in	each _X_C_o_l_o_r
  structure, and sets the _D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e flags in each structure.


  _X_Q_u_e_r_y_C_o_l_o_r and _X_Q_u_e_r_y_C_o_l_o_r_s can generate _B_a_d_C_o_l_o_r and _B_a_d_V_a_l_u_e errors.

  The _X_L_o_o_k_u_p_C_o_l_o_r function looks up the string	name of	a color	with respect
  to the screen	associated with	the specified colormap.	 It returns both the
  exact	color values and the closest values provided by	the screen with
  respect to the visual	type of	the specified colormap.	 If the	color name is
  not in the Host Portable Character Encoding the result is implementation
  dependent.  Use of uppercase or lowercase does not matter.  _X_L_o_o_k_u_p_C_o_l_o_r
  returns nonzero if the name is resolved, otherwise it	returns	zero.

  The _X_P_a_r_s_e_C_o_l_o_r function looks up the	string name of a color with respect
  to the screen	associated with	the specified colormap.	 It returns the	exact
  color	value.	If the color name is not in the	Host Portable Character
  Encoding the result is implementation	dependent.  Use	of uppercase or
  lowercase does not matter.  _X_P_a_r_s_e_C_o_l_o_r returns nonzero if the name is
  resolved, otherwise it returns zero.

  _X_L_o_o_k_u_p_C_o_l_o_r and _X_P_a_r_s_e_C_o_l_o_r can generate _B_a_d_C_o_l_o_r error.

COLOR NAMES
  An RGB Device	specification is identified by the prefix "rgb:" and conforms
  to the following syntax:

  rgb:<_r_e_d>/<_g_r_e_e_n>/<_b_l_u_e>

      <_r_e_d>, <_g_r_e_e_n>, <_b_l_u_e> :=	_h | _h_h | _h_h_h | _h_h_h_h
      _h	:= single hexadecimal digits (case insignificant)

  Note that _h indicates	the value scaled in 4 bits, _h_h the value scaled	in 8
  bits,	_h_h_h the	value scaled in	12 bits, and _h_h_h_h the value scaled in 16
  bits,	respectively.

  For backward compatibility, an older syntax for RGB Device is	supported,
  but its continued use	is not encouraged.  The	syntax is an initial sharp
  sign character followed by a numeric specification, in one of	the following
  formats:

  #RGB	  (4 bits each)
  #RRGGBB (8 bits each)
  #RRRGGGBBB	  (12 bits each)
  #RRRRGGGGBBBB	  (16 bits each)

  The R, G, and	B represent single hexadecimal digits.	When fewer than	16
  bits each are	specified, they	represent the most-significant bits of the
  value	(unlike	the "rgb:" syntax, in which values are scaled).	 For example,
  #3a7 is the same as #3000a0007000.

  An RGB intensity specification is identified by the prefix "rgbi:" and con-
  forms	to the following syntax:

  rgbi:<_r_e_d>/<_g_r_e_e_n>/<_b_l_u_e>

  Note that red, green,	and blue are floating point values between 0.0 and
  1.0, inclusive.  The input format for	these values is	an optional sign, a
  string of numbers possibly containing	a decimal point, and an	optional
  exponent field containing an E or e followed by a possibly signed integer
  string.

  The standard device-independent string specifications	have the following
  syntax:

  CIEXYZ:<_X>/<_Y>/<_Z>
  CIEuvY:<_u>/<_v>/<_Y>
  CIExyY:<_x>/<_y>/<_Y>
  CIELab:<_L>/<_a>/<_b>
  CIELuv:<_L>/<_u>/<_v>
  TekHVC:<_H>/<_V>/<_C>

  All of the values (C,	H, V, X, Y, Z, a, b, u,	v, y, x) are floating point
  values.  The syntax for these	values is an optional '+' or '-' sign, a
  string of digits possibly containing a decimal point,	and an optional
  exponent field consisting of an 'E' or 'e' followed by an optional '+' or
  '-' followed by a string of digits.

DIAGNOSTICS

  _B_a_d_C_o_l_o_r  A value for	a Colormap argument does not name a defined Colormap.

  _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of values accepted by
	    the	request.  Unless a specific range is specified for an argu-
	    ment, the full range defined by the	argument's type	is accepted.
	    Any	argument defined as a set of alternatives can generate this
	    error.

SEE ALSO
  XAllocColor(3X11), XCreateColormap(3X11), XStoreColors(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e



































