adjcolors: Convert a color with specified alpha level

View source: R/colors.R

adjcolorsR Documentation

Convert a color with specified alpha level

Description

Convert a color with specified alpha level

Usage

adjcolors(colors, alpha)

Arguments

colors

Color vectors.

alpha

Alpha level in ⁠[0,1]⁠.

Value

A character vector of hexadecimal color codes with the specified alpha level.

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)
  )
)

thisplot documentation built on March 7, 2026, 5:07 p.m.