


XStoreColors(3X11)					   XStoreColors(3X11)
X11R5									X11R5



NAME
  XStoreColors,	XStoreColor, XStoreNamedColor -	set colors

SYNTAX
  XStoreColors(_d_i_s_p_l_a_y,	_c_o_l_o_r_m_a_p, _c_o_l_o_r, _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 _c_o_l_o_r[];
	int _n_c_o_l_o_r_s;

  XStoreColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	XColor *_c_o_l_o_r;

  XStoreNamedColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r, _p_i_x_e_l, _f_l_a_g_s)
	Display	*_d_i_s_p_l_a_y;
	Colormap _c_o_l_o_r_m_a_p;
	char *_c_o_l_o_r;
	unsigned long _p_i_x_e_l;
	int _f_l_a_g_s;

ARGUMENTS

  _c_o_l_o_r	    Specifies the pixel	and RGB	values or the color name string	(for
	    example, red).

  _c_o_l_o_r	    Specifies an array of color	definition structures to be stored.

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

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

  _f_l_a_g_s	    Specifies which red, green,	and blue components are	set.

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

  _p_i_x_e_l	    Specifies the entry	in the colormap.

DESCRIPTION
  The _X_S_t_o_r_e_C_o_l_o_r_s function changes the	colormap entries of the	pixel values
  specified in the pixel members of the	_X_C_o_l_o_r structures.  You	specify	which
  color	components are to be changed by	setting	_D_o_R_e_d, _D_o_G_r_e_e_n,	and/or _D_o_B_l_u_e
  in the flags member of the _X_C_o_l_o_r structures.	 If the	colormap is an
  installed map	for its	screen,	the changes are	visible	immediately.
  _X_S_t_o_r_e_C_o_l_o_r_s changes the specified pixels if they are	allocated writable in
  the colormap by any client, even if one or more pixels generates an error.
  If a specified pixel is not a	valid index into the colormap, a _B_a_d_V_a_l_u_e
  error	results.  If a specified pixel either is unallocated or	is allocated
  read-only, a _B_a_d_A_c_c_e_s_s error results.	 If more than one pixel	is in error,
  the one that gets reported is	arbitrary.

  _X_S_t_o_r_e_C_o_l_o_r_s can generate _B_a_d_A_c_c_e_s_s, _B_a_d_C_o_l_o_r, and _B_a_d_V_a_l_u_e errors.

  The _X_S_t_o_r_e_C_o_l_o_r function changes the colormap	entry of the pixel value
  specified in the pixel member	of the _X_C_o_l_o_r structure.  You specified	this
  value	in the pixel member of the _X_C_o_l_o_r structure.  This pixel value must
  be a read/write cell and a valid index into the colormap.  If	a specified
  pixel	is not a valid index into the colormap,	a _B_a_d_V_a_l_u_e error results.
  _X_S_t_o_r_e_C_o_l_o_r also changes the red, green, and/or blue color components.  You
  specify which	color components are to	be changed by setting _D_o_R_e_d, _D_o_G_r_e_e_n,
  and/or _D_o_B_l_u_e	in the flags member of the _X_C_o_l_o_r structure.  If the colormap
  is an	installed map for its screen, the changes are visible immediately.

  _X_S_t_o_r_e_C_o_l_o_r can generate _B_a_d_A_c_c_e_s_s, _B_a_d_C_o_l_o_r,	and _B_a_d_V_a_l_u_e errors.

  The _X_S_t_o_r_e_N_a_m_e_d_C_o_l_o_r function	looks up the named color with respect to the
  screen associated with the colormap and stores the result in the specified
  colormap.  The pixel argument	determines the entry in	the colormap.  The
  flags	argument determines which of the red, green, and blue components are
  set. You can set this	member to the bitwise inclusive	OR of the bits _D_o_R_e_d,
  _D_o_G_r_e_e_n, and _D_o_B_l_u_e.	If the color name is not in the	Host Portable Charac-
  ter Encoding the result is implementation dependent.	Use of uppercase or
  lowercase does not matter.  If the specified pixel is	not a valid index
  into the colormap, a _B_a_d_V_a_l_u_e	error results.	If the specified pixel either
  is unallocated or is allocated read-only, a _B_a_d_A_c_c_e_s_s	error results.

  _X_S_t_o_r_e_N_a_m_e_d_C_o_l_o_r can generate	_B_a_d_A_c_c_e_s_s, _B_a_d_C_o_l_o_r, _B_a_d_N_a_m_e, and _B_a_d_V_a_l_u_e
  errors.

DIAGNOSTICS

  _B_a_d_A_c_c_e_s_s A client attempted to free a color map entry that it did not
	    already allocate.

  _B_a_d_A_c_c_e_s_s A client attempted to store	into a read-only color map entry.

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

  _B_a_d_N_a_m_e   A font or color of the specified name does not exist.

  _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), 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























