Returns a function function(n) that selects n colours from the named palette.
This factory is used internally by scale_colour_stem() and scale_fill_stem() to
satisfy ggplot2's discrete scale interface, but can also be called directly.
Diverging palettes use select_diverging() to pick colours that preserve the
symmetric structure of the palette. All other palette types return the first n colours,
optionally reversed.
Arguments
- palette
Name of the palette. See
stem_palette()for the full list of valid names.- direction
1(default) returns colours in their natural order;-1reverses the order.