Welcome to python-colorspace’s documentation!

python-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 code and ideas of the R colorspace package as it has often been requested by python enthusiasts. More information and an interactive interface can also be found on HCLwizard.org.

The package itself can be found on github this documentation is also available on ReadTheDocs.

Other Packages and Further Reading

More information and further reading:

  • hclwizard.org: more information about the HCL color space, introduction to the colorspace packages (in 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 (on top of the default color maps) wich might be of interest:

  • seaborn: statistical data visualization. The package also provides access to a range of (mostly) well specified. color palettes.
  • palettable: color palettes for python. Formely known as brewer2mpl. Provides a range of color palettes including “Brewer2” and “Carto” palettes.
  • ColorBrewer2.org: the source of the brewer colors, interactive webpage by Cynthia Brewer, Mark Harrower and The Pennsylvania State University.

Known issues

Warning

White point implemented but might require some additional testing.

TODO’s

Todo

Introduction to the three basic principles of the diverging, sequential, and qualitative color maps.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/python-colorspace/checkouts/latest/docs/hclcolorspace.rst, line 107.)

Todo

Handling of alpha values. And, in addition, add support for hex colors. Currently a list of hex colors as input is not allowed (fix it).

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/python-colorspace/checkouts/latest/colorspace/CVD.py:docstring of CVD.desaturate, line 27.)

Todo

Implement the smoothings to improve the look of the plots. Only partially implemented, the spline smoother is missing.

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/python-colorspace/checkouts/latest/colorspace/specplot.py:docstring of specplot.specplot, line 31.)