home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xquerycolor.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  8.0 KB  |  265 lines

  1.  
  2.  
  3.  
  4. XQueryColor(3X11)      XLIB FUNCTIONS    XQueryColor(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XQueryColor, XQueryColors, XLookupColor, XParseColor -
  9.        obtain color values
  10.  
  11. SSYYNNTTAAXX
  12.        XQueryColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _d_e_f___i_n___o_u_t)
  13.          Display *_d_i_s_p_l_a_y;
  14.          Colormap _c_o_l_o_r_m_a_p;
  15.          XColor *_d_e_f___i_n___o_u_t;
  16.  
  17.        XQueryColors(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _d_e_f_s___i_n___o_u_t, _n_c_o_l_o_r_s)
  18.          Display *_d_i_s_p_l_a_y;
  19.          Colormap _c_o_l_o_r_m_a_p;
  20.          XColor _d_e_f_s___i_n___o_u_t[];
  21.          int _n_c_o_l_o_r_s;
  22.  
  23.        Status XLookupColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r___n_a_m_e,
  24.        _e_x_a_c_t___d_e_f___r_e_t_u_r_n, _s_c_r_e_e_n___d_e_f___r_e_t_u_r_n)
  25.          Display *_d_i_s_p_l_a_y;
  26.          Colormap _c_o_l_o_r_m_a_p;
  27.          char *_c_o_l_o_r___n_a_m_e;
  28.          XColor *_e_x_a_c_t___d_e_f___r_e_t_u_r_n, *_s_c_r_e_e_n___d_e_f___r_e_t_u_r_n;
  29.  
  30.        Status XParseColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _s_p_e_c,
  31.        _e_x_a_c_t___d_e_f___r_e_t_u_r_n)
  32.            Display *_d_i_s_p_l_a_y;
  33.            Colormap _c_o_l_o_r_m_a_p;
  34.            char *_s_p_e_c;
  35.            XColor *_e_x_a_c_t___d_e_f___r_e_t_u_r_n;
  36.  
  37. AARRGGUUMMEENNTTSS
  38.        _c_o_l_o_r_m_a_p     Specifies the colormap.
  39.  
  40.        _c_o_l_o_r___n_a_m_e
  41.          Specifies the color name string (for example,
  42.          red) whose color definition structure you want
  43.          returned.
  44.  
  45.        _d_e_f___i_n___o_u_t
  46.          Specifies and returns the RGB values for the
  47.          pixel specified in the structure.
  48.  
  49.        _d_e_f_s___i_n___o_u_t
  50.          Specifies and returns an array of color defini-
  51.          tion structures for the pixel specified in the
  52.          structure.
  53.  
  54.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  55.  
  56.        _e_x_a_c_t___d_e_f___r_e_t_u_r_n
  57.          Returns the exact RGB values.
  58.  
  59.        _n_c_o_l_o_r_s     Specifies the number of _X_C_o_l_o_r structures in the
  60.          color definition array.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XQueryColor(3X11)      XLIB FUNCTIONS    XQueryColor(3X11)
  71.  
  72.  
  73.        _s_c_r_e_e_n___d_e_f___r_e_t_u_r_n
  74.          Returns the closest RGB values provided by the
  75.          hardware.
  76.  
  77.        _s_p_e_c     Specifies the color name string; case is
  78.          ignored.
  79.  
  80.        _e_x_a_c_t___d_e_f___r_e_t_u_r_n
  81.          Returns the exact color value for later use and
  82.          sets the _D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e flags.
  83.  
  84. DDEESSCCRRIIPPTTIIOONN
  85.        The _X_Q_u_e_r_y_C_o_l_o_r function returns the current RGB value for
  86.        the pixel in the _X_C_o_l_o_r structure and sets the _D_o_R_e_d,
  87.        _D_o_G_r_e_e_n, and _D_o_B_l_u_e flags.  The _X_Q_u_e_r_y_C_o_l_o_r_s function
  88.        returns the RGB value for each pixel in each _X_C_o_l_o_r struc-
  89.        ture and sets the _D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e flags in each
  90.        structure.
  91.  
  92.  
  93.        _X_Q_u_e_r_y_C_o_l_o_r and _X_Q_u_e_r_y_C_o_l_o_r_s can generate _B_a_d_C_o_l_o_r and
  94.        _B_a_d_V_a_l_u_e errors.
  95.  
  96.        The _X_L_o_o_k_u_p_C_o_l_o_r function looks up the string name of a
  97.        color with respect to the screen associated with the spec-
  98.        ified colormap.    It returns both the exact color values
  99.        and the closest values provided by the screen with respect
  100.        to the visual type of the specified colormap.  If the
  101.        color name is not in the Host Portable Character Encoding,
  102.        the result is implementation-dependent.    Use of uppercase
  103.        or lowercase does not matter.  _X_L_o_o_k_u_p_C_o_l_o_r returns
  104.        nonzero if the name is resolved; otherwise, it returns
  105.        zero.
  106.  
  107.        The _X_P_a_r_s_e_C_o_l_o_r function looks up the string name of a
  108.        color with respect to the screen associated with the spec-
  109.        ified colormap.    It returns the exact color value.  If the
  110.        color name is not in the Host Portable Character Encoding,
  111.        the result is implementation-dependent.    Use of uppercase
  112.        or lowercase does not matter.  _X_P_a_r_s_e_C_o_l_o_r returns nonzero
  113.        if the name is resolved; otherwise, it returns zero.
  114.  
  115.        _X_L_o_o_k_u_p_C_o_l_o_r and _X_P_a_r_s_e_C_o_l_o_r can generate _B_a_d_C_o_l_o_r error.
  116.  
  117. CCOOLLOORR NNAAMMEESS
  118.        An RGB Device specification is identified by the prefix
  119.        ``rgb:'' and conforms to the following syntax:
  120.  
  121.        rgb:_<_r_e_d_>_/_<_g_r_e_e_n_>_/_<_b_l_u_e_>
  122.  
  123.        _<_r_e_d_>, _<_g_r_e_e_n_>, _<_b_l_u_e_> := _h | _h_h | _h_h_h | _h_h_h_h
  124.        _h := single hexadecimal digits (case insignificant)
  125.  
  126.        Note that _h indicates the value scaled in 4 bits, _h_h the
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XQueryColor(3X11)      XLIB FUNCTIONS    XQueryColor(3X11)
  137.  
  138.  
  139.        value scaled in 8 bits, _h_h_h the value scaled in 12 bits,
  140.        and _h_h_h_h the value scaled in 16 bits, respectively.
  141.  
  142.        For backward compatibility, an older syntax for RGB Device
  143.        is supported, but its continued use is not encouraged.
  144.        The syntax is an initial sharp sign character followed by
  145.        a numeric specification, in one of the following formats:
  146.  
  147.        #RGB           (4 bits each)
  148.        #RRGGBB           (8 bits each)
  149.        #RRRGGGBBB       (12 bits each)
  150.        #RRRRGGGGBBBB       (16 bits each)
  151.  
  152.        The R, G, and B represent single hexadecimal digits.  When
  153.        fewer than 16 bits each are specified, they represent the
  154.        most significant bits of the value (unlike the ``rgb:''
  155.        syntax, in which values are scaled).  For example, the
  156.        string ``#3a7'' is the same as ``#3000a0007000''.
  157.  
  158.        An RGB intensity specification is identified by the prefix
  159.        ``rgbi:'' and conforms to the following syntax:
  160.  
  161.        rgbi:_<_r_e_d_>_/_<_g_r_e_e_n_>_/_<_b_l_u_e_>
  162.  
  163.        Note that red, green, and blue are floating-point values
  164.        between 0.0 and 1.0, inclusive.    The input format for
  165.        these values is an optional sign, a string of numbers pos-
  166.        sibly containing a decimal point, and an optional exponent
  167.        field containing an E or e followed by a possibly signed
  168.        integer string.
  169.  
  170.        The standard device-independent string specifications have
  171.        the following syntax:
  172.  
  173.        CIEXYZ:_<_X_>_/_<_Y_>_/_<_Z_>
  174.        CIEuvY:_<_u_>_/_<_v_>_/_<_Y_>
  175.        CIExyY:_<_x_>_/_<_y_>_/_<_Y_>
  176.        CIELab:_<_L_>_/_<_a_>_/_<_b_>
  177.        CIELuv:_<_L_>_/_<_u_>_/_<_v_>
  178.        TekHVC:_<_H_>_/_<_V_>_/_<_C_>
  179.  
  180.        All of the values (C, H, V, X, Y, Z, a, b, u, v, y, x) are
  181.        floating-point values.  The syntax for these values is an
  182.        optional plus or minus sign, a string of digits possibly
  183.        containing a decimal point, and an optional exponent field
  184.        consisting of an ``E'' or ``e'' followed by an optional
  185.        plus or minus followed by a string of digits.
  186.  
  187. DDIIAAGGNNOOSSTTIICCSS
  188.        _B_a_d_C_o_l_o_r     A value for a Colormap argument does not name a
  189.          defined Colormap.
  190.  
  191.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  192.          values accepted by the request.  Unless a
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XQueryColor(3X11)      XLIB FUNCTIONS    XQueryColor(3X11)
  203.  
  204.  
  205.          specific range is specified for an argument, the
  206.          full range defined by the argument's type is
  207.          accepted.  Any argument defined as a set of
  208.          alternatives can generate this error.
  209.  
  210. SSEEEE AALLSSOO
  211.        XAllocColor(3X11), XCreateColormap(3X11), XStoreCol-
  212.        ors(3X11)
  213.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.