Skip to content

palettes

from charite_plot.palettes import PALETTES, make_palette

See the Palettes guide for visual palette strips and usage examples.


PALETTES

Type: dict[str, list[str]]

Named palettes and their constituent hex colors:

Name Colors
primary #004d9b · #7e898f · #cbcfd2
secondary #002552 · #007bc3 · #ea5451
mono #000000 · #7e898f · #cbcfd2
light #007bc3 · #cbcfd2
versus #004d9b · #e31f2c
nineties #564091 · #88c69a · #009aa9
brickhouse #89014c · #d74b7f · #88c69a · #008939
sunrise #002552 · #007bc3 · #ffdf43 · #fab600
berryseason #d74b7f · #944292 · #6f186d · #002552 · #c8b8ad · #89725b
goldelse #fab600 · #ffdf43 · #d1d811 · #a1ba0c · #61c3d7 · #009aa9 · #7876b6 · #564091

make_palette

make_palette(name_or_colors, n=None, reverse=False)

Return a list of hex colors from a named palette or custom color list.

Parameters:

Name Type Description Default
name_or_colors str | list[str]

A palette name (see PALETTES) or a list of hex color strings.

required
n int | None

Number of colors to return. None returns all colors in the palette. If n is larger than the palette, colors are linearly interpolated. If n is smaller, colors are subsampled evenly.

None
reverse bool

Reverse the palette before sampling.

False