NAME
XcmsQueryColor, XcmsQueryColors, XcmsLookupColor - obtain color values
SYNTAX
Status XcmsQueryColor(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 XcmsQueryColors(Display *_d_i_s_p_l_a_y, Colormap
_c_o_l_o_r_m_a_p, XcmsColor _c_o_l_o_r_s___i_n___o_u_t[], unsigned int
_n_c_o_l_o_r_s, XcmsColorFormat _r_e_s_u_l_t___f_o_r_m_a_t);
Status XcmsLookupColor(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, XcmsColor
*_c_o_l_o_r___e_x_a_c_t___r_e_t_u_r_n, XcmsColor *_c_o_l_o_r___s_c_r_e_e_n___r_e_t_u_r_n,
XcmsColorFormat _r_e_s_u_l_t___f_o_r_m_a_t);
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 database.
-
_c_o_l_o_r___i_n___o_u_t
Specifies the pixel member that indicates the color cell to query.
-
The color specification stored for the color cell is returned in this
_X_c_m_s_C_o_l_o_r
structure.
-
_c_o_l_o_r___s_c_r_e_e_n___r_e_t_u_r_n
Returns the color that can be reproduced on the screen.
-
-
_c_o_l_o_r___s_t_r_i_n_g
Specifies the color string.
-
-
_r_e_s_u_l_t___f_o_r_m_a_t
Specifies the color format for the returned color
-
specifications (color_screen_return and color_exact_return arguments).
If the format is
_X_c_m_s_U_n_d_e_f_i_n_e_d_F_o_r_m_a_t
and the color string contains a
numerical color specification,
the specification is returned in the format used in that numerical
color specification.
If the format is
_X_c_m_s_U_n_d_e_f_i_n_e_d_F_o_r_m_a_t
and the color string contains a color name,
the specification is returned in the format used
to store the color in the database.
-
_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_Q_u_e_r_y_C_o_l_o_r
function obtains the RGB value
for the pixel value in the pixel member of the specified
_X_c_m_s_C_o_l_o_r
structure and then
converts the value to the target format as
specified by the result_format argument.
If the pixel is not a valid index in the specified colormap, a
_B_a_d_V_a_l_u_e
error results.
The
_X_c_m_s_Q_u_e_r_y_C_o_l_o_r_s
function obtains the RGB values
for pixel values in the pixel members of
_X_c_m_s_C_o_l_o_r
structures and then
converts the values to the target format as
specified by the result_format argument.
If a pixel is not a valid index into the specified colormap, a
_B_a_d_V_a_l_u_e
error results.
If more than one pixel is in error,
the one that gets reported is arbitrary.
_X_c_m_s_Q_u_e_r_y_C_o_l_o_r
and
_X_c_m_s_Q_u_e_r_y_C_o_l_o_r_s
can generate
_B_a_d_C_o_l_o_r
and
_B_a_d_V_a_l_u_e
errors.
The
_X_c_m_s_L_o_o_k_u_p_C_o_l_o_r
function looks up the string name of a color with respect to the screen
associated with the specified colormap.
It returns both the exact color values and
the closest values provided by the screen
with respect to the visual type of the specified colormap.
The values are returned in the format specified by result_format.
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.
_X_c_m_s_L_o_o_k_u_p_C_o_l_o_r
returns
_X_c_m_s_S_u_c_c_e_s_s
or
_X_c_m_s_S_u_c_c_e_s_s_W_i_t_h_C_o_m_p_r_e_s_s_i_o_n
if the name is resolved; otherwise, it returns
_X_c_m_s_F_a_i_l_u_r_e.
If
_X_c_m_s_S_u_c_c_e_s_s_W_i_t_h_C_o_m_p_r_e_s_s_i_o_n
is returned, the color specification returned in
color_screen_return is the result of gamut compression.
DIAGNOSTICS
-
_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),
XcmsStoreColor(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