gray

Gray Level Specification

Create a vector of colors from a vector of gray levels.

Keywords
color
Usage
gray(level, alpha = NULL) grey(level, alpha = NULL)
Arguments
level
a vector of desired gray levels between 0 and 1; zero indicates "black" and one indicates "white".
alpha
the opacity, if specified.
Details

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

grey is an alias for gray.

Value

A vector of colors of the same length as level.

See Also

rainbow, hsv, hcl, rgb.

Aliases
  • gray
  • grey
Examples
library(grDevices) gray(0:8 / 8)
Documentation reproduced from package grDevices, version 3.1.2, License: Part of R 3.1.2

Community examples

Looks like there are no examples yet.