rainbow_hcl               package:vcd               R Documentation

_H_C_L _a_n_d _H_S_V _C_o_l_o_r _P_a_l_e_t_t_e_s

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

     Color palettes based on the HCL and HSV color spaces.

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

     rainbow_hcl(n, c = 50, l = 70, start = 0, end = 360*(n-1)/n, ...)

     diverge_hcl(n, h = c(260, 0), c = 100, l = c(90, 50), ...)
     diverge_hsv(n, h = c(2/3, 0), s = 1, v = 1, ...)  

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

       n: the number of colors (

                                 >= 1

          ) to be in the palette.

       c: chroma value in the HCL color description.

       l: luminance value in the HCL color description.

   start: the hue at which the rainbow begins.

     end: the hue at which the rainbow ends.

       h: hue value in the HCL or HSV color description, has to be in
          [0, 360] for HCL and in [0, 1] for HSV colors.

       s: saturation value in the HSV color description.

       v: value value in the HSV color description.

     ...: Other arguments passed to 'hcl' or 'hsv', respectively.

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

     All three functions compute palettes based on either the HCL or
     the HSV color space. 'rainbow_hcl' computes a rainbow of colors
     defined by different hues given a single value of each chroma and
     luminance. It corresponds to 'rainbow' which computes a rainbow in
     HSV space.

     Both functions, 'diverge_hcl' and 'diverge_hsv', compute  a set of
     colors diverging from a neutral center (grey or white, without
     color) to two different extreme colors (blue and red by default).
     This is similar to 'cm.colors'. For the diverging HSV colors, two
     hues 'h' are needed, a maximal saturation 's' and a fixed value
     'v'. The saturation is then varied to obtain the diverging colors.
     For the diverging HCL colors, again two hues 'h' are needed, a
     maximal chroma 'chroma' and two luminances 'l'. The colors are
     then created by linear interpolation between the  neutral color
     (with zero chroma and luminance 'l[1]') and  the full color (with
     chroma 'c' and luminance 'l[2]').

     The diverging palettes are used for choosing the colors for mosaic
      displays in 'mosaic'.

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

     Achim Zeileis Achim.Zeileis@R-project.org

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

     'hcl', 'hsv', 'shadings'

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

     pie(rep(1, 12), col = rainbow_hcl(12))
     pie(rep(1, 5), col = diverge_hcl(5))
     pie(rep(1, 5), col = diverge_hsv(5))

     ## a few useful diverging HCL palettes
     pie(rep(1, 7), col = diverge_hcl(7))
     pie(rep(1, 7), col = diverge_hcl(7, h = c(246, 40), c = 96, l = c(90, 65)))
     pie(rep(1, 7), col = diverge_hcl(7, h = c(130, 43), c = 100, l = c(90, 70)))
     pie(rep(1, 7), col = diverge_hcl(7, h = c(180, 70), c = 70, l = c(95, 90)))
     pie(rep(1, 7), col = diverge_hcl(7, h = c(180, 330), c = 59, l = c(95, 75)))
     pie(rep(1, 7), col = diverge_hcl(7, h = c(128, 330), c = 98, l = c(90, 65)))
     pie(rep(1, 7), col = diverge_hcl(7, h = c(255, 330)))

