adjcolors: Convert a color with arbitrary transparency to a fixed color

View source: R/SCP-plot.R

adjcolorsR Documentation

Convert a color with arbitrary transparency to a fixed color

Description

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)
ggplot2::alpha(colors, 0.5)

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


zh542370159/SCP documentation built on Nov. 22, 2023, 2:34 a.m.