A Python Toolbox for Manipulating and Assessing Colors and Palettes

colorspace is a Python package to create and handle colors and color palettes in Python. Based on the Hue-Chroma-Luminance (HCL) color space effective color palettes can be designed and implemented in your own daily workflow.

This package is based on the R colorspace package to make the tools easily available for Python enthusiasts. More information and an interactive interface can also be found on HCLwizard.org.

The package itself can be found on GitHub and this documentation is also available on GitHub Pages.

Contents

Community guidelines

Everyone is warmly welcome to contribute to Python colorspace by addressing existing issues, reporting bugs, or requesting new features. Please refer to our Community guidelines for more information.

Other packages and further reading

  • HCLwizard.org: More information about the HCL color space, introduction to the colorspace packages (available for R and Python), and some interactive tools to define effective HCL-based color palettes, pick colors, and check existing plots and figures for possible problems in terms of color vision deficiencies.
  • A list of scientific articles which provide more detailed insights, e.g.,
  • The end of the rainbow: An open letter to the climate science community by Ed Hawkins, Doug McNeall, David Stephenson, Jonny Williams & Dave Carlson.
  • Better Figures: Constructive criticism of the graphics of climate science by Doug McNeall.

Scientific articles with more detailed insights:

Some other packages providing color maps in Python wich might be of interest:

  • matplotlib: Library for creating visualizations. Provides a range of (mostly) well specified color maps colormaps.
  • seaborn: Statistical data visualization. The package also provides access to a range of (mostly) well specified color palettes.
  • plotly: Graphing library for interactive plots and figures which comes with a series of built-in and (mostly) well defined color scales.
  • palettable: Color palettes for Python. Formely known as brewer2mpl. Provides a range of color palettes including “Brewer2” and “Carto” palettes.
  • cmcrameri: Python package with a few series of sequential and diverging color palettes.
  • colormap: Python package providing access to a series of color palettes and functionality to create own (fixed-color) palettes.
  • colormaps: Collection of color palettes for Python to be used with matplotlib (e.g., cartocolors, brewer palettes, …).
  • ColorBrewer2.org: The source of the brewer colors, interactive web page by Cynthia Brewer, Mark Harrower, and The Pennsylvania State University.