cccc [ _f_l_a_g ... ] _f_i_l_e ... -llXXeexxtt [ _l_i_b_r_a_r_y ... ] #includeStatus XXccuuppSSttoorreeCCoolloorrss(Display *_d_i_s_p_l_a_y, Colormap _c_o_l_o_r_m_a_p, XColor *_c_o_l_o_r_s___i_n___o_u_t, int _n_c_o_l_o_r_s);
The _X_c_u_p_S_t_o_r_e_C_o_l_o_r_s function changes the colormap entries of the pixel values in the pixel members of the XColor structures. The colormap entries are allocated as if an AllocColor has been used instead, i.e. the colors are read-only (shareable). _X_c_u_p_S_t_o_r_e_C_o_l_o_r_s returns the number of colors that were successfully allocated in the colormap.
A _V_a_l_u_e error is generated if a pixel is not a valid index into the colormap. A _B_a_d_M_a_t_c_h error is generated if the colormap does not belong to a GrayScale, PseudoColor, or DirectColor visual.
Applications which allocate many colors in a screen's default colormap, e.g. a color-cube or a gray-ramp, should allocate them with _X_C_u_p_S_t_o_r_e_C_o_l_o_r_s. By using XCupStoreColors the colors will be allocated sharable (read-only) and any other application which allocates the same color will share that color cell.