NAME

XcmsStoreColor, XcmsStoreColors - set colors

SYNTAX

Status XcmsStoreColor(Display *_d_i_s_p_l_a_y, Colormap _c_o_l_o_r_m_a_p, XcmsColor *_c_o_l_o_r); Status XcmsStoreColors(Display *_d_i_s_p_l_a_y, Colormap _c_o_l_o_r_m_a_p, XcmsColor _c_o_l_o_r_s[], int _n_c_o_l_o_r_s, Bool _c_o_m_p_r_e_s_s_i_o_n___f_l_a_g_s___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 Specifies the color cell and the color to store.
Values specified in this _X_c_m_s_C_o_l_o_r structure remain unchanged on return.
_c_o_l_o_r_s Specifies the color specification array of
_X_c_m_s_C_o_l_o_r structures, each specifying a color cell and the color to store in that cell. Values specified in the array remain unchanged upon return.
_c_o_l_o_r_m_a_p Specifies the colormap.
_c_o_m_p_r_e_s_s_i_o_n___f_l_a_g_s___r_e_t_u_r_n Returns an array of Boolean values indicating compression status.
If a non-NULL pointer is supplied, each element of the array is set to _T_r_u_e if the corresponding color was compressed and _F_a_l_s_e otherwise. Pass NULL if the compression status is not useful.
_n_c_o_l_o_r_s Specifies the number of
_X_c_m_s_C_o_l_o_r structures in the color-specification array.

DESCRIPTION

The _X_c_m_s_S_t_o_r_e_C_o_l_o_r function converts the color specified in the _X_c_m_s_C_o_l_o_r structure into RGB values. It then uses this RGB specification in an _X_C_o_l_o_r structure, whose three flags (_D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e) are set, in a call to _X_S_t_o_r_e_C_o_l_o_r to change the color cell specified by the pixel member of the _X_c_m_s_C_o_l_o_r structure. This pixel value must be a valid index for the specified colormap, and the color cell specified by the pixel value must be a read/write cell. If the pixel value is not a valid index, a _B_a_d_V_a_l_u_e error results. If the color cell is unallocated or is allocated read-only, a _B_a_d_A_c_c_e_s_s error results. If the colormap is an installed map for its screen, the changes are visible immediately.

Note that _X_S_t_o_r_e_C_o_l_o_r has no return value; therefore, an _X_c_m_s_S_u_c_c_e_s_s return value from this function indicates that the conversion to RGB succeeded and the call to _X_S_t_o_r_e_C_o_l_o_r was made. To obtain the actual color stored, use _X_c_m_s_Q_u_e_r_y_C_o_l_o_r. Because of the screen's hardware limitations or gamut compression, the color stored in the colormap may not be identical to the color specified.

_X_c_m_s_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_c_m_s_S_t_o_r_e_C_o_l_o_r_s function converts the colors specified in the array of _X_c_m_s_C_o_l_o_r structures into RGB values and then uses these RGB specifications in _X_C_o_l_o_r structures, whose three flags (_D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e) are set, in a call to _X_S_t_o_r_e_C_o_l_o_r_s to change the color cells specified by the pixel member of the corresponding _X_c_m_s_C_o_l_o_r structure. Each pixel value must be a valid index for the specified colormap, and the color cell specified by each pixel value must be a read/write cell. If a pixel value is not a valid index, a _B_a_d_V_a_l_u_e error results. If a color cell 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. If the colormap is an installed map for its screen, the changes are visible immediately.

Note that _X_S_t_o_r_e_C_o_l_o_r_s has no return value; therefore, an _X_c_m_s_S_u_c_c_e_s_s return value from this function indicates that conversions to RGB succeeded and the call to _X_S_t_o_r_e_C_o_l_o_r_s was made. To obtain the actual colors stored, use _X_c_m_s_Q_u_e_r_y_C_o_l_o_r_s. Because of the screen's hardware limitations or gamut compression, the colors stored in the colormap may not be identical to the colors specified.

_X_c_m_s_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.

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_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

XcmsAllocColor(3X11), XcmsQueryColor(3X11)
_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e