This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/rgb.html
rgb {base}R Documentation

RGB Color Specification

Description

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.

Usage

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

See Also

rainbow, hsv, gray.

Examples

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

[Package base version 0.60 ]