Skip to contents

A function to create a custom qualitative colors palette from the Okabe-Ito palette, reversed if rev_colors is set to TRUE. Drops black and yellow for use with all Blackstone charts and adds three other colors: "#440154FF", "#283251", and "#999933".

Usage

qualFillColors(n_colors = 11, rev_colors = FALSE)

Arguments

n_colors

Required, supply a non-negative integer that is the desired the number of color hex codes to return.

rev_colors

Logical, defaults to FALSE, if true returns a reverse color codes where the darkest color comes first.

Value

a character vector of hex color codes the length of n_colors.

Examples

# Returns the full color palette:
qualFillColors()
#>  [1] "#E69F00"   "#56B4E9"   "#009E73"   "#CC79A7"   "#D55E00"   "#0072B2"  
#>  [7] "#440154FF" "#999999"   "#117733"   "#283251"   "#999933"  

# Returns the first 5 colors in the palette:
qualFillColors(n_colors = 5)
#> [1] "#E69F00" "#56B4E9" "#009E73" "#CC79A7" "#D55E00"

# Returns the first 5 colors in the palette reversed:
qualFillColors(n_colors = 5, rev_colors = TRUE)
#> [1] "#D55E00" "#CC79A7" "#009E73" "#56B4E9" "#E69F00"