Returns hex codes for a color-vision-aware categorical palette. Most
palettes are runtime wrappers around RColorBrewer::brewer.pal() so the
authoritative colors stay in their source package.
Arguments
- name
Discrete palette name. Built-in:
"dark2_8"(default, RColorBrewer Dark2),"set2_8"(RColorBrewer Set2),"paired_12"(RColorBrewer Paired),"aaa_5"(custom AAA-on-white set).- n
Optional number of colors. Defaults to the palette's full size (truncates from the start when smaller).
- bg
Plot background context. One of
NULL(default – no check),"white", or"dark". When set, the function warns if the palette'ssafe_ontag does not match.
Value
Character vector of hex codes (e.g., "#1B9E77"). For sequential
gradients, see a11y_palette_seq().