phontrast_palette: Okabe-Ito color palette used by phontrast plots

View source: R/theme_phontrast.R

phontrast_paletteR Documentation

Okabe-Ito color palette used by phontrast plots

Description

Returns n colors from the Okabe-Ito palette, a qualitative palette designed to be distinguishable under the common forms of color-vision deficiency. The palette is reordered so the first two colors (blue and vermillion) form the highest-contrast pair for two-category contrasts. For more than eight groups the palette is interpolated, with a warning, since interpolated qualitative colors lose their guarantees.

Usage

phontrast_palette(n = NULL)

Arguments

n

Number of colors to return. Defaults to the full palette.

Value

A character vector of n hex colors, named for n <= 8.

Examples

phontrast_palette()
phontrast_palette(2)

phontrast documentation built on Oct. 7, 2026, 5:06 p.m.