adjustcolor
Alter a color specification

Description

Transforms colors to related colors.

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 a vector of color strings or indices acceptable to col2rdb.
alpha.f the factor by which to change the alpha (opacity) component of the color.
red.f the factor by which to change the red component of the color.
green.f the factor by which to change the green component of the color.
blue.f the factor by which to change the blue component of the color.
offset a vector of numbers in the range -1 to +1 giving an additive change to the four color components.
  • Negative one (-1) sets the color component to zero.
  • Positive 1 (+1) increases the color component to its maximum value, 255.
Its length must be a multiple of 4.
transform a 4 by 4 matrix used to multiply the input red-green-blue-alpha values. By default, transform is constructed from the red.f, green.f, blue.f, and alpha.f values so each is changed independently of the others.
Value
returns a vector of color strings in the format "#RRGGBBAA", giving the 2-digit hexadecimal values for the red, green, blue, and alpha (opacity) components of the modified colors.
See Also
col2rgb, colorRamp.
Examples
adjustcolor(c("red", "orange", "#004040a0"), alpha.f = 0.25) # make translucent colors
Package grDevices version 6.0.0-69
Package Index