ondri_palette: An ONDRI palette generator

Description Usage Arguments Details Value Examples

View source: R/colours.R

Description

These are a handful of colour palettes standard within ONDRI.

Usage

1
ondri_palette(name, start = 1, end, n, is_discrete = TRUE)

Arguments

name

Name of desired palette. Choices are: all_colours (or all_colors), cohorts

start

Starting index of colours desired. If omitted, starts at 1.

end

Ending index of colours desired. If omitted, ends at last colour in palette list.

n

Number of colours desired for type="continuous". If omitted, uses amount of discrete colours in range [start:end].

is_discrete

Either TRUE or FALSE. Set to FALSE if you want to automatically interpolate between colours.

Details

This function heavily borrows from Karthik Ram's wesanderson package, and specifically https://github.com/karthik/wesanderson/blob/master/R/colors.R

Value

A vector of colours.

Examples

1
2
3
4
5
6
7
8
9
ondri_palette("all_colours")
ondri_palette("cohorts")
ondri_palette("cohorts", n = 20, is_discrete = FALSE)

# If you need more colours than normally found in a palette, you
# can use a continuous palette to interpolate between existing
# colours
pal <- ondri_palette(name = "all_colours", start = 3, n = 20, is_discrete = FALSE)
image(volcano, col = pal)

ondri-nibs/ondricolors documentation built on Sept. 10, 2020, 12:04 a.m.