Registry / data / colourmap

colourmap

JSON →
library1.2.1pypypi✓ verified 90d ago

The `colourmap` Python package, currently at version 1.2.1, generates N unique colors from a specified input colormap or list of colors. It also provides utilities for converting between RGB and HEX color formats and can create linear gradients. The package appears to have a moderate release cadence, with recent updates in late 2025.

pip install colourmap
INSTALL
IMPORT
SIG · COLOURMAP
C
colourmap
datapythonv1.2.1
Install
11.2s avg
Import
2590ms
Disk
321MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 2.637s · 318.9MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 11.2s · import 2.542s · 306MB
321MB installed
● package 321MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

colourmap
✓ from colourmap import colourmap
The package name and the main function/class are both 'colourmap' (with 'u').

This quickstart demonstrates how to generate unique colors using the `colourmap` function from a default colormap or a provided list of colors. It also shows the utility functions for converting between RGB and HEX color formats. The core functionality is `generate_unique_colors` which can take an `n_colors` parameter or an `input_colors` list.

from colourmap import colourmap # Generate 5 unique colors from a default colormap colors_hex = colourmap.generate_unique_colors(n_colors=5) print(f"Generated HEX colors: {colors_hex}") # Generate 3 unique colors from a specified list of input colors (e.g., using a seaborn palette) # For demonstration, we'll use a simple list; in a real scenario, this might come from seaborn.color_palette input_palette = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b'] colors_from_palette_hex = colourmap.generate_unique_colors(input_colors=input_palette, n_colors=3) print(f"Generated HEX colors from palette: {colors_from_palette_hex}") # Convert RGB to HEX rgb_color = (255, 0, 0) hex_color = colourmap.rgb_to_hex(rgb_color) print(f"RGB {rgb_color} to HEX: {hex_color}") # Convert HEX to RGB hex_color_input = '#00FF00' rgb_color_output = colourmap.hex_to_rgb(hex_color_input) print(f"HEX {hex_color_input} to RGB: {rgb_color_output}")
colourmap --version
Debug
Known issues
gotchaThere are multiple Python packages with similar names ('colormap', 'cmap', 'colormaps'). Ensure you are installing and importing 'colourmap' (with 'u') if you intend to use this specific library.
fix
Verify your `pip install` command and `from ... import ...` statements. The correct installation is `pip install colourmap` and the main import is `from colourmap import colourmap`.
affects: All
gotchaThe `generate_unique_colors` function can take either `n_colors` (to generate from an internal colormap) or `input_colors` (to sample from a provided list). Using both might lead to unexpected behavior or an error depending on the implementation details for argument precedence.
fix
Always pass either `n_colors` OR `input_colors`, but not both, to `generate_unique_colors` for clarity and predictable results. Consult the official documentation for specific argument priority if both are present.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'colormap'
Attempted to import 'colormap' (without 'u') when the installed package is 'colourmap' (with 'u').
fix
Change your import statement to `from colourmap import colourmap`.
TypeError: generate_unique_colors() got an unexpected keyword argument 'cmap_name'
You are trying to specify a colormap by name directly with a 'cmap_name' argument, which is not supported by this library's `generate_unique_colors` function. It implicitly uses an internal colormap or expects `input_colors`.
fix
If you want to use a specific colormap (e.g., from matplotlib or seaborn), first generate a list of colors from that colormap using its respective library, and then pass that list to `colourmap.generate_unique_colors` via the `input_colors` parameter.
Upgrade
Version history
1.2.1latest on PyPI · released Nov 7, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
colourmap — pip install colourmap · libregistry