skillfed

colourmap

Python package colourmap generates an N unique colors from the specified input colormap.

colourmap v1.2.1 131.1K downloads/30d#11,603 on PyPI5
Permissive license MIT AGING released

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 colourmap

uv

uv add colourmap

poetry

poetry add colourmap

Installing 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

Intended Audience :: EducationIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: UnixProgramming Language :: Python :: 3

Tags

generate unique colors from labelsrgb hex color conversioncolor mapping for visualizationmatplotlib colormap wrapperassign colors to categories
color-generationvisualization-utility

More Graphics packages