colourmap
Python package colourmap generates an N unique colors from the specified input colormap.
What it is and what it does
Colourmap is a utility for generating and managing color palettes programmatically. It wraps matplotlib, numpy, and scipy to create unique RGB and HEX color assignments from input lists or labels, making it useful for visualization tasks where you need consistent color mapping across categories or data points.
The package provides functions to generate N colors from a colormap, assign colors to input labels, convert between RGB and HEX formats, and create linear gradients between colors. It's designed for scientific and educational use, targeting developers building visualizations in Python who need deterministic, repeatable color assignment without manually managing palettes.
Use it for:
- Assign consistent colors to categorical data in plots based on unique labels or group IDs
- Generate a palette of N distinct colors for multi-series visualization or dashboard design
- Convert between RGB and HEX color formats for web and graphics applications
- Create smooth color gradients between two colors for heatmaps or sequential visualizations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates unique RGB and HEX colors from input lists or colormaps, with support for color conversion and gradient creation.
Yes, if you need straightforward color generation and label-to-color mapping for visualizations. The package is lightweight, has no security vulnerabilities, and its three dependencies are standard. However, the aging maintenance status (280 days since last release) means you should verify it works with your current matplotlib/scipy versions before relying on it for production work.
Install
colourmap on PyPI
pip
pip install colourmapuv
uv add colourmappoetry
poetry add colourmapInstalling colourmap
Before you install
Low friction install with three well-established dependencies (matplotlib, numpy, scipy). Package is aging—last release 280 days ago—but repo remains active and unarchived.
License in practice
MIT license permits commercial and private use with minimal restrictions; safe for most projects.
Quickstart
pip install colourmap
from colourmap import colourmap
# Generate 10 unique colors
c = colourmap.generate(10)
# Create colors from labels
c_rgb, c_dict = colourmap.fromlist([1, 1, 2, 2, 3])
# Convert to HEX
c_hex = colourmap.rgb2hex(c_rgb)
Verify before relying
- Whether the package handles edge cases (empty lists, very large label sets) gracefully
- Performance characteristics when working with thousands of unique labels
- Compatibility with recent matplotlib/scipy versions beyond 'supports_current'
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — matplotlib, numpy, scipy |
| Maintenance | aging — 280 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 131,116/month — #11,603 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: colourmap-1.2.1-py3-none-any.whl
Keywords: Python
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
colourConverts between and manipulates color…
permissive · top 5,000 on PyPI
distinctipyGenerates lists of visually distinct colors of…
permissive · top 15,000 on PyPI
imgvizimgviz provides image visualization utilities…
permissive · top 15,000 on PyPI
cmapcmap provides a collection of scientific…
permissive · top 15,000 on PyPI
brewer2mplProvides access to all 165 ColorBrewer2.org…
permissive · top 15,000 on PyPI
colorhashGenerates deterministic colors from any object…
permissive · top 15,000 on PyPI
cmcrameriProvides perceptually uniform colormaps by…
permissive · top 15,000 on PyPI
colorcetColorcet provides a collection of perceptually…
unclear · top 5,000 on PyPI
materialyoucolorGenerates Material Design 3 color schemes and…
unclear · top 15,000 on PyPI
cmoceanProvides perceptually uniform colormaps…
unclear · top 15,000 on PyPI