Skip to contents

This function takes a vector of colors and an alpha level and converts the colors to fixed colors with the specified alpha level.

Usage

adjcolors(colors, alpha)

Arguments

colors

Color vectors.

alpha

Alpha level in [0,1]

Examples

colors <- c("red", "blue", "green")
adjcolors(colors, 0.5)
#>        V1        V2        V3 
#> "#FF8080" "#8080FF" "#80FF80" 
ggplot2::alpha(colors, 0.5)
#> [1] "#FF000080" "#0000FF80" "#00FF0080"

show_palettes(list(
  "raw" = colors,
  "adjcolors" = adjcolors(colors, 0.5),
  "ggplot2::alpha" = ggplot2::alpha(colors, 0.5)
))

#> [1] "raw"            "adjcolors"      "ggplot2::alpha"