

_C_o_l_o_r _P_a_l_e_t_t_e_s

     rainbow(n, s = 1, v = 1, start = 0, end = max(1,n - 1)/n, gamma = 1)
     heat.colors(n)
     terrain.colors(n)
     topo.colors(n)

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

       n: the number of colors (>= 1) to be in the palette.

     s,v: the ``saturation'' and ``value'' to be used to
          complete the HSV color descriptions.

   start: the (corrected) hue in [0,1] at which the rainbow
          begins.

     end: the (corrected) hue in [0,1] at which the rainbow
          ends.

   gamma: the gamma correction, see `hsv(.., gamma)'.

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

     These functions create a vector of `n' ``contiguous''
     colors.  Conceptually, all of these functions actually
     use (parts of) a line cut out of the 3-dimensional
     color space, parametrized by `hsv(h,s,v, gamma)', where
     `gamma'=1 for the foo`.colors' function, and hence,
     equispaced hues in RGB space tend to cluster at the
     red, green and blue primaries.

     Some applications such as contouring require a palette
     of colors which do not ``wrap around'' to give a final
     color close to the starting one.  With `rainbow', the
     parameters `start' and `end' can be used to specify
     particular subranges of hues.  The following values can
     be used when generating such a subrange:  red=0, yel-
     low=1/6, green=2/6, cyan=3/6, blue=4/6 and magenta=5/6.

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

     A character vector, `cv', of color names.  This can be
     used either to create a userdefined color palette for
     subsequent graphics by `palette(cv)', a `col=' specifi-
     cation in graphics functions or in `par'.

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

     `colors', `palette',  `hsv', `rgb', `gray'.

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

     # A Color Wheel
     piechart(rep(1,12), col=rainbow(12))

     ##------ Some palettes ------------
     n <- if(.Device == "postscript") 64 else 16
     ## For screen, larger n may give color allocation problem
     i <- 1:n
     d <- n/20; dy <- 2*d; j <- n%/%4
     plot(i,i+d, type='n', main=paste("color palettes;  n=",n))
     rect(i-.5,     dy, i+.4,   j, col=rainbow(n, start=.7, end=.1))
     text(2*j,    j+dy/4,             "rainbow(n, start=.7, end=.1)")
     rect(i-.5,   j+dy, i+.4, 2*j, col=heat.colors(n))
     text(2*j,  2*j+dy/4,             "heat.colors(n)")
     rect(i-.5, 2*j+dy, i+.4, 3*j, col=terrain.colors(n))
     text(2*j,  3*j+dy/4,             "terrain.colors(n)")
     rect(i-.5, 3*j+dy, i+.4, 4*j, col=topo.colors(n))
     text(2*j,  4*j+dy/4,             "topo.colors(n)")

