Learn R Programming

thisplot (version 0.3.1)

blendcolors: Blends a list of colors using the specified blend mode

Description

Blends a list of colors using the specified blend mode

Usage

blendcolors(colors, mode = c("blend", "average", "screen", "multiply"))

Value

A character vector of hexadecimal color codes representing the blended color.

Arguments

colors

Color vectors.

mode

Blend mode. One of "blend", "average", "screen", or "multiply".

Examples

Run this code
blend <- c(
  "red",
  "green",
  blendcolors(c("red", "green"),
    mode = "blend"
  )
)
average <- c(
  "red",
  "green",
  blendcolors(c("red", "green"),
    mode = "average"
  )
)
screen <- c(
  "red",
  "green",
  blendcolors(c("red", "green"),
    mode = "screen"
  )
)
multiply <- c(
  "red",
  "green",
  blendcolors(c("red", "green"),
    mode = "multiply"
  )
)
show_palettes(
  list(
    "blend" = blend,
    "average" = average,
    "screen" = screen,
    "multiply" = multiply
  )
)

Run the code above in your browser using DataLab