Colour Brewer palette (discrete)

Usage

brewer_pal(type = "seq", palette = 1, direction = 1)

Arguments

type

One of "seq" (sequential), "div" (diverging) or "qual" (qualitative)

palette

If a string, will use that named palette. If a number, will index into the list of palettes of appropriate type

direction

Sets the order of colours in the scale. If 1, the default, colours are as output by RColorBrewer::brewer.pal(). If -1, the order of colours is reversed.

References

https://colorbrewer2.org

Examples

show_col(brewer_pal()(10))
#> Warning: n too large, allowed maximum for palette Blues is 9
#> Returning the palette you asked for with that many colors

show_col(brewer_pal("div")(5))

show_col(brewer_pal(palette = "Greens")(5))

cols <- brewer_pal("div")(5)