Skip to contents

Returns the first n colors of the chosen palette. Beyond the seeds of the palette the colors come from Polychrome::createPalette() if Polychrome is installed and from grDevices::hcl.colors() otherwise. These extra colors are not colorblind-safe; a colorblind-safe palette warns when it runs out of seeds.

Usage

dMod2_palette(n, palette = "okabe")

Arguments

n

Integer, number of colors.

palette

Name of a qualitative palette, see dMod2_palettes(). Defaults to "okabe".

Value

Character vector of length n with hex color codes.

Examples

dMod2_palette(3)
#> [1] "#000000" "#E69F00" "#56B4E9"
dMod2_palette(3, palette = "muted")
#> [1] "#332288" "#88CCEE" "#44AA99"