Learn R Programming

thisplot (version 0.3.1)

adjcolors: Convert a color with specified alpha level

Description

Convert a color with specified alpha level

Usage

adjcolors(colors, alpha)

Value

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

Arguments

colors

Color vectors.

alpha

Alpha level in [0,1].

Examples

Run this code
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)
  )
)

Run the code above in your browser using DataLab