getMultipleColors: Get multiple distinct colors using viridis package.

View source: R/color.R

getMultipleColorsR Documentation

Get multiple distinct colors using viridis package.

Description

See details: https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html

Usage

getMultipleColors(
  types,
  alpha = 1,
  b = 0,
  e = 1,
  direction = 1,
  pal = viridis,
  showColor = FALSE
)

Arguments

types

vector/array, which we want to assign each element with a distinct color

alpha

numeric, default is 1

b

numeric, 0,1 color begin value, default is 0

e

numeric, 0,1 color end value, default is 1 , no less than b NOTE, both b and e are calculated from the right-side in the color scales.

direction

1 or -1, default is 1 If 1, colors are ordered from darkest to lightest. If -1, the order of colors is reversed.

pal

literal, color palette to use, default is viridis (no "" needed)

showColor

bool, after generating the color if need to show colors with scales::show_col, default FALSE

Value

vector of characters with types as names. Each element represents one color.


beyondpie/pureRUtils documentation built on Jan. 10, 2023, 3:22 a.m.