Color Handling

The epipack.colors module provides a large collection of colors and palettes that can used for visualizations and plots


The dictionary

  • hex_colors

maps color names to hex codes.

The dictionary

  • colors

maps color names to rgb tuples (in [0,255]).

Every color is associated with an accompanying lighter or darker version of itself. The dictionary

  • accompanying_color

maps color names to their respective counterparts.


Palettes are lists of color names. The dictionary

  • palettes

maps palette names to such lists of color names.

Every palette is associated with a link color and a back ground color. These are encoded in

  • hex_bg_colors, and

  • hex_link_colors

as well as

  • bg_colors and

  • link_colors

for the rgb tuple version.

You can load palettes like this:

from epipack.colors import hex_colors, colors, palettes

pal_name = 'dark'
these_hex_colors = [ hex_colors[col] for col in palettes[pal_name] ]
these_rgb_colors = [ colors[col] for col in palettes[pal_name] ]

These are all available palettes:

>>> palettes['dark']
>>> palettes['dark pastel']
>>> palettes['light']
>>> palettes['light pastel']
>>> palettes['french79']
>>> palettes['french79 pastel']
>>> palettes['brewer light']
>>> palettes['brewer light pastel']
>>> palettes['brewer dark']
>>> palettes['brewer dark pastel']