


XcmsAllocColor(3X11)					 XcmsAllocColor(3X11)
X11R5									X11R5



NAME
  XcmsAllocColor, XcmsAllocNamedColor -	allocate colors

SYNTAX
  Status XcmsAllocColor(_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 XcmsAllocNamedColor(_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, _r_e_s_u_l_t__f_o_r_m_a_t,
  _c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n,
			      _c_o_l_o_r__e_x_a_c_t__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__s_t_r_i_n_g;
	XcmsColorFormat	_r_e_s_u_l_t__f_o_r_m_a_t;
	XcmsColor *_c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n;
	XcmsColor *_c_o_l_o_r__e_x_a_c_t__r_e_t_u_r_n;

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 color	to allocate and	returns	the pixel and color
	    that is actually used in the colormap.

  _c_o_l_o_r__s_c_r_e_e_n__r_e_t_u_r_n
	    Returns the	pixel value of the color cell and color	specification
	    that actually is stored for	that cell.

  _c_o_l_o_r__s_t_r_i_n_g
	    Specifies the color	string whose color definition structure	is to
	    be returned.

  _r_e_s_u_l_t__f_o_r_m_a_t
	    Specifies the color	format for the returned	color specification.

DESCRIPTION
  The _X_c_m_s_A_l_l_o_c_C_o_l_o_r function is similar to _X_A_l_l_o_c_C_o_l_o_r	except the color can
  be specified in any format.  The _X_c_m_s_A_l_l_o_c_C_o_l_o_r function ultimately calls
  _X_A_l_l_o_c_C_o_l_o_r to allocate a read-only color cell (colormap entry) with the
  specified color.  _X_c_m_s_A_l_l_o_c_C_o_l_o_r first converts the color specified to an
  RGB value and	then passes this to _X_A_l_l_o_c_C_o_l_o_r.  _X_c_m_s_A_l_l_o_c_C_o_l_o_r returns the
  pixel	value of the color cell	and the	color specification actually allo-
  cated.  This returned	color specification is the result of converting	the
  RGB value returned by	_X_A_l_l_o_c_C_o_l_o_r into the format specified with the
  result_format	argument.  If there is no interest in a	returned color
  specification, unnecessary computation can be	bypassed if result_format is
  set to _X_c_m_s_R_G_B_F_o_r_m_a_t.	 The corresponding colormap cell is read-only.	If
  this routine returns _X_c_m_s_F_a_i_l_u_r_e, the	color_in_out color specification is
  left unchanged.

  _X_c_m_s_A_l_l_o_c_C_o_l_o_r can generate a	_B_a_d_C_o_l_o_r errors.

  The _X_c_m_s_A_l_l_o_c_N_a_m_e_d_C_o_l_o_r function is similar to _X_A_l_l_o_c_N_a_m_e_d_C_o_l_o_r except the
  color	returned can be	in any format specified.  This function	ultimately
  calls	_X_A_l_l_o_c_C_o_l_o_r to allocate	a read-only color cell with the	color speci-
  fied by a color string.  The color string is parsed into an _X_c_m_s_C_o_l_o_r
  structure (see _X_c_m_s_L_o_o_k_u_p_C_o_l_o_r), converted to	an RGB value, then finally
  passed to the	_X_A_l_l_o_c_C_o_l_o_r.  If the color name	is not in the Host Portable
  Character Encoding the result	is implementation dependent.  Use of upper-
  case or lowercase does not matter.

  This function	returns	both the color specification as	a result of parsing
  (exact specification)	and the	actual color specification stored (screen
  specification).  This	screen specification is	the result of converting the
  RGB value returned by	_X_A_l_l_o_c_C_o_l_o_r into the format specified in
  result_format.  If there is no interest in a returned	color specification,
  unnecessary computation can be bypassed if result_format is set to
  _X_c_m_s_R_G_B_F_o_r_m_a_t.

  _X_c_m_s_A_l_l_o_c_N_a_m_e_d_C_o_l_o_r can generate a _B_a_d_C_o_l_o_r errors.

DIAGNOSTICS

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

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



































