NAME

XStoreColors, XStoreColor, XStoreNamedColor - set colors

SYNTAX

int XStoreColors(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); int XStoreColor(Display *_d_i_s_p_l_a_y, Colormap _c_o_l_o_r_m_a_p, XColor *_c_o_l_o_r); int XStoreNamedColor(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 Character 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 argument, 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