Learn R Programming

graphx (version 1.0)

lightness: Change lightness of a color

Description

Change lightness of a color

Usage

lightness(col, light = 0.5)

Arguments

col

is a color or vector/array of colors, specified as text (e.g. 'purple') or 7/9-character (e.g. '#A020F0')

light

lightness value, according to a HSL scheme, between 0 and 1 or a vector/array thereof

Value

Returns a 9-character color or vector/array of 9-character colors.

See Also

transparent

Examples

Run this code
# NOT RUN {
# Generate different lightnesses of the same color
plot(runif(50),runif(50),pch=20,cex=10,col=lightness('purple',runif(50)))

# }

Run the code above in your browser using DataLab