## Adjust Colors in One or More Directions Conveniently

### Description

Adjust or modify a vector of colors by “turning knobs” on one or more coordinates in (r,g,b,\alpha) space, typically by up or down scaling them.

### Usage

adjustcolor(col, alpha.f = 1, red.f = 1, green.f = 1, blue.f = 1,
offset = c(0, 0, 0, 0),
transform = diag(c(red.f, green.f, blue.f, alpha.f)))

### Arguments

 col vector of colors, in any format that col2rgb() accepts alpha.f factor modifying the opacity alpha; typically in [0,1] red.f, green.f, blue.f factors modifying the “red-”, “green-” or “blue-”ness of the colors, respectively. offset numeric vector of length 4 to offset x := c(r,g,b,alpha), where x is the [0,1]-scaled result of col2rgb(col, alpha=TRUE). transform a 4x4 numeric matrix applied to x + offset.

### Value

a color vector of the same length as col, effectively the result of rgb().

rgb, col2rgb. For more sophisticated color constructions: convertColor

### Examples

## Illustrative examples :
opal <- palette("default")

##  alpha = 1/2 * previous alpha --> opaque colors

sines <- outer(1:20, 1:4, function(x, y) sin(x / 20 * pi * y))
matplot(sines, type = "b", pch = 21:23, col = 2:5, bg = 2:5,
main = "Using an 'opaque ('translucent') color palette")

x. <- adjustcolor(x, offset = c(0.5, 0.5, 0.5, 0), # <- "more white"
transform = diag(c(.7, .7, .7, 0.6)))
cbind(x, x.)
op <- par(bg = adjustcolor("goldenrod", offset = -rep(.4, 4)), xpd = NA)
plot(0:9, 0:9, type = "n", axes = FALSE, xlab = "", ylab = "",