


XcmsQueryColor(3X11)					 XcmsQueryColor(3X11)
X11R5									X11R5



NAME
  XcmsQueryColor, XcmsQueryColors, XcmsLookupColor - obtain color values

SYNTAX
  Status XcmsQueryColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r__i_n__o_u_t, _r_e_s_u_l_t__f_o_r_m_a_t)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	XcmsColor *_c_o_l_o_r__i_n__o_u_t;
	XcmsColorFormat	_r_e_s_u_l_t__f_o_r_m_a_t;

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

  Status XcmsLookupColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r__s_t_r_i_n_g, _c_o_l_o_r__e_x_a_c_t__r_e_t_u_r_n,
  _c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n,
			   _r_e_s_u_l_t__f_o_r_m_a_t)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	char *_c_o_l_o_r__s_t_r_i_n_g;
	XcmsColor *_c_o_l_o_r__e_x_a_c_t__r_e_t_u_r_n, *_c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n;
	XcmsColorFormat	_r_e_s_u_l_t__f_o_r_m_a_t;

ARGUMENTS

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

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

  _c_o_l_o_r__e_x_a_c_t__r_e_t_u_r_n
	    Returns the	color specification parsed from	the color string or
	    parsed from	the corresponding string found in a color name data-
	    base.

  _c_o_l_o_r__i_n__o_u_t
	    Specifies the pixel	member that indicates the color	cell to
	    query, and the color specification stored for the color cell is
	    returned in	this _X_c_m_s_C_o_l_o_r structure.

  _c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n
	    Returns the	color that can be reproduced on	the _S_c_r_e_e_n.

  _c_o_l_o_r__s_t_r_i_n_g
	    Specifies the color	string.

  _r_e_s_u_l_t__f_o_r_m_a_t
	    Specifies the color	format for the returned	color specifications
	    (color_screen_return and color_exact_return	arguments).  If
	    format is _X_c_m_s_U_n_d_e_f_i_n_e_d_F_o_r_m_a_t and the color	string contains	a
	    numerical color specification, the specification is	returned in
	    the	format used in that numerical color specification.  If format
	    is _X_c_m_s_U_n_d_e_f_i_n_e_d_F_o_r_m_a_t and the color string	contains a color
	    name, the specification is returned	in the format used to store
	    the	color in the database.

  _n_c_o_l_o_r_s   Specifies the number of _X_c_m_s_C_o_l_o_r structures in the	color specif-
	    ication array.

DESCRIPTION
  The _X_c_m_s_Q_u_e_r_y_C_o_l_o_r function obtains the RGB value for	the pixel value	in
  the pixel member of the specified _X_c_m_s_C_o_l_o_r structure, and then converts
  the value to the target format as specified by the result_format argument.
  If the pixel is not a	valid index into the specified colormap, a _B_a_d_V_a_l_u_e
  error	results.  The _X_c_m_s_Q_u_e_r_y_C_o_l_o_r_s function obtains the RGB values for
  pixel	values in the pixel members of _X_c_m_s_C_o_l_o_r structures, and then con-
  verts	the values to the target format	as specified by	the result_format
  argument.  If	a pixel	is not a valid index into the specified	colormap, a
  _B_a_d_V_a_l_u_e error results.  If more than	one pixel is in	error, the one that
  gets reported	is arbitrary.

  _X_c_m_s_Q_u_e_r_y_C_o_l_o_r and _X_c_m_s_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_c_m_s_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.  The values are
  returned in the format specified by result_format.  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_c_m_s_L_o_o_k_u_p_C_o_l_o_r
  returns _X_c_m_s_S_u_c_c_e_s_s or _X_c_m_s_S_u_c_c_e_s_s_W_i_t_h_C_o_m_p_r_e_s_s_i_o_n if the name	is resolved,
  otherwise it returns _X_c_m_s_F_a_i_l_u_r_e.  If	_X_c_m_s_S_u_c_c_e_s_s_W_i_t_h_C_o_m_p_r_e_s_s_i_o_n is
  returned, then the color specification in _c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n	is the result
  of gamut compression.

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
  XcmsAllocColor(3X11),	XcmsStoreColor(3X11), XQueryColor(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e






















