An alpha transparency value can be specified to a color, in order to get better color for background.

highlightCol(col, alpha = 0.5)

Arguments

col

vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i].

alpha

a value in [0, 1]

Value

a vector of colors in hexadecimal string of the form "#rrggbbaa".

Author

Jianhong Ou

Examples

highlightCol(1:5, 0.3)
#> [1] "#0000004D" "#DF536B4D" "#61D04F4D" "#2297E64D" "#28E2E54D"
highlightCol(c("red", "green", "blue"), 0.3)
#> [1] "#FF00004D" "#00FF004D" "#0000FF4D"