hex                package:colorspace                R Documentation

_C_o_n_v_e_r_t _C_o_l_o_r_s _T_o _H_e_x_a_d_e_c_i_m_a_l _S_t_r_i_n_g_s

_D_e_s_c_r_i_p_t_i_o_n:

     This functions converts ``color'' objects into hexadecimal
     strings.

_U_s_a_g_e:

     hex(from, gamma = 2.2, fixup = FALSE)

_A_r_g_u_m_e_n_t_s:

    from: The color object to be converted.

   gamma: The display _gamma_ value.

   fixup: Should the color be corrected to a valid RGB value before
          correction.  The default is to convert out-of-gamut colors to
          the string '"NA"'.

_D_e_t_a_i_l_s:

     The color objects are first converted to RGB color objects. They
     are then multiplied by 255 and rounded to obtain an integer value.
      These values are then converted to hexadecimal strings of the
     form '"#RRGGBB"' and suitable for use as color descriptions for R
     graphics.  Out of gamut values are either corrected to valid RGB
     values by translating the the individual primary values so that
     they lie between 0 and 255.

_V_a_l_u_e:

     A vector of character strings.

_A_u_t_h_o_r(_s):

     Ross Ihaka

_S_e_e _A_l_s_o:

     'hex2RGB', 'RGB', 'HSV', 'XYZ', 'LAB', 'polarLAB', 'LUV',
     'polarLUV'.

_E_x_a_m_p_l_e_s:

     hsv = HSV(seq(0,360,length=7)[-7], 1, 1)
     barplot(rep(1,6), col=hex(hsv))

