Qualpal

Automatically Generate Qualitative Color Palettes

Qualpal automatically generates qualitative color palettes with distinct, perceptually uniform colors. It uses sophisticated algorithms based on perceptual color difference metrics to ensure that the colors in the palette are easily distinguishable from each other.

Installation

Qualpal is on PyPi and can be installed via pip:

pip install qualpal

If you want visualization support (requires matplotlib), install with:

pip install qualpal[viz]

Quick Start

As a quick example, here’s how to generate a palette with 6 distinct colors:

from qualpal import Qualpal

# Generate a palette with 6 distinct colors
qp = Qualpal()
palette = qp.generate(6)

palette
#eba5fc
#026808
#af0d27
#035079
#0bf2dc
#ffbb44

Features

  • Automatic selection of color palettes using perceptual color difference metrics

  • Color vision deficiency simulation for accessible palette design

  • Multiple input formats: RGB values, hex strings, HSL ranges, built-in palettes

  • Fast algorithms for large color spaces

Web App

If you simply want to generate color palettes without coding or want to see what Qualpal has to offer at a glance, check out the Qualpal web app.

Citation

Qualpal is based on the C++ library with the same name. If you happen to use qualpal in your research, please cite the following paper:

Larsson, J. (2025). Qualpal: Qualitative Color Palettes for Everyone. Journal of Open Source Software, 10(114), 8936. https://doi.org/10.21105/joss.08936

Here’s an example BibTeX entry:

License

MIT License - see LICENSE

Installation From Source

If you want to install the latest development version, you can install directly from the GitHub repository.

uv pip install git+https://github.com/jolars/qualpal-py

Requirements:

  • Python 3.9+

  • C++ compiler (for building the extension)

  • CMake 3.15+

References

Based on the qualpal C++ library: https://github.com/jolars/qualpal