palettes¶
See the Palettes guide for visual palette strips and usage examples.
PALETTES¶
Type: dict[str, list[str]]
The Charité palettes and their 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 |
BIH_PALETTES¶
Type: dict[str, list[str]]
The BIH palettes, in charite_plot.brands.bih (and BIH.palettes). Pass brand="bih" to use them by name,
e.g. make_palette("accents", brand="bih").
| Name | Colors |
|---|---|
primary |
#003754 · #668798 · #b2c3cc |
accents |
#003754 · #009aa9 · #9d7220 · #ea5451 · #7876b6 |
mono |
#000000 · #666666 · #b2b2b2 |
light |
#009aa9 · #cccccc |
versus |
#003754 · #ea5451 |
make_palette¶
make_palette(name_or_colors, n=None, reverse=False, brand=DEFAULT_BRAND)
¶
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 of brand (see |
required |
n
|
int | None
|
Number of colors to return. |
None
|
reverse
|
bool
|
Reverse the palette before sampling. |
False
|
brand
|
str | Brand
|
Brand name or |
DEFAULT_BRAND
|
make_ramp¶
make_ramp(name_or_colors, reverse=False, brand=DEFAULT_BRAND)
¶
Return the color stops of a continuous scale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_colors
|
str | list[str]
|
Palette names take precedence over |
required |
reverse
|
bool
|
Reverse the gradient. |
False
|
brand
|
str | Brand
|
Brand name or |
DEFAULT_BRAND
|
Examples:
Altair interpolates between the stops itself; interpolate="rgb" matches matplotlib:
make_cmap¶
make_cmap(name_or_colors, reverse=False, brand=DEFAULT_BRAND, n=256)
¶
Return a continuous matplotlib colormap; see make_ramp for the accepted names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_colors
|
str | list[str]
|
Palette name, color name, hex color or list of hex colors (see |
required |
reverse
|
bool
|
Reverse the colormap. |
False
|
brand
|
str | Brand
|
Brand name or |
DEFAULT_BRAND
|
n
|
int
|
Number of entries in the colormap's lookup table. |
256
|
Examples: