gg_CreateColors: Create a vector of colors based on a color scale

View source: R/gg_CreateColors.R

gg_CreateColorsR Documentation

Create a vector of colors based on a color scale

Description

Function to create a vector of colors based on a color scale.

Usage

gg_CreateColors(n, scale = "hue", ..., show = FALSE)

Arguments

n
  • number of colours to create

scale
  • name of scale to use (see Details)

...
  • passed on to the scale

show
  • show colours using scales::show_col()

Details

Available color scales (and default parameters) are

  • "hue" - ...: none (see scales::hue_pal())

  • "brewer" - ...: type="seq", palette=1, direction=1 (see scales::brewer_pal())

  • "viridis" - ...: alpha=1,begin=0,end=0,direction=1,option='D' (see scales::viridis_pal())

Value

a vector of colors.

See Also

scales::hue_pal(), scales::brewer_pal(),scales::viridis_pal()

Examples

gg_CreateColors(3,show=TRUE);
gg_CreateColors(3,"brewer",show=TRUE);
gg_CreateColors(3,"viridis",show=TRUE); 


wStockhausen/wtsUtilities documentation built on March 16, 2024, 10:38 a.m.