rgb                   package:base                   R Documentation

_R_G_B _C_o_l_o_r _S_p_e_c_i_f_i_c_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     This function creates ``colors'' corresponding to the given
     intensities (between 0 and 1) of the red, green and blue
     primaries. The names argument may be used to provide names for the
     colors.

     The values returned by `rgb' can be used with a `col='
     specification in graphics functions or in `par'.

_U_s_a_g_e:

     rgb(red, green, blue, names=NULL)

_A_r_g_u_m_e_n_t_s:

red, blue, green: vector in [0, 1].

   names: character. The names for the resulting vector.

_S_e_e _A_l_s_o:

     `col2rgb' the ``inverse'' for translating R colors to RGB vectors.
     `rainbow', `hsv', `gray'.

_E_x_a_m_p_l_e_s:

     rgb(0,1,0)
     u01 <- seq(0,1, length=11); all(rgb(u01,u01,u01) == gray(u01))
     reds <- rgb((0:15)/15, g=0,b=0, names=paste("red",0:15,sep="."))
     reds

