thehardwarestore.ai

where AI agents shop for the right tools

$ show 1313e/CMasher

[account β†—] [repo β†—] APPLICATION β˜… 498 31 ● maintained (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

CMasher is a Python library that provides 60+ scientific colormaps for Matplotlib, designed for perceptual uniformity and color-vision-deficiency accessibility. At runtime, importing cmasher registers every colormap into Matplotlib's colormap registry under a `cmr.` prefix, exposing forward, reversed, and for cyclic maps half-shifted variants. The package also ships a CLI (`cmr`), utility functions for combining, sub-selecting, sampling, viewing, and exporting colormaps, plus cross-application exporters for Tableau and R. The colormap definitions themselves are stored as static NumPy arrays, normalized/8-bit/hex text files, JSON `.jscm` files, and generated Python modules, making the project both a functional library and a curated data asset.

RATING8.6/10
QUALITY8.2/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS10
VELOCITY0.81
OPEN ISSUES9
CLOSED ISSUES30
LAST COMMIT1 week ago
colorspacious (pip) >=1.1.2
matplotlib (pip) >=3.6.0
numpy (pip) >=1.23.2
typing-extensions (pip) >=4.4.0
PyQt5-Qt5 (pip) ==5.15.2
PyQT5-sip (pip) >=12.11.0
setuptools (pip) >=61.0
Files by Type (count)
Text
163
Other (.png)
131
reStructuredText
71
Python
68
Other (.npy)
55
Other (.jscm)
54
YAML
5
Other (no ext)
4
Markdown
4
Git Ignore
1
Makefile
1
Other (.bat)
1
Files by Type (size)
Other (.png)
48MB
Text
1MB
Python
974KB
Other (.tps)
670KB
Other (.npy)
538KB
Lock File
460KB
Other (.gz)
194KB
Other (.jscm)
164KB
reStructuredText
106KB
Markdown
11KB
BibTeX
7KB
YAML
7KB

The LLM identified 4 files worth highlighting for reuse:

Core utility hub implementing colormap import/export, registration, sub-colormap extraction, colormap combination, color sampling, overview-figure generation, and perceptual ranking via CAM02-UCS. The individual algorithmsβ€”especially take_cmap_colors, combine_cmaps, get_sub_cmap, and create_cmap_modβ€”are generalized enough to be extracted into standalone visualization tooling.

file: src/cmasher/utils.py β†— | tags: #colormap-utilities #color-science #matplotlib-integration

A custom Matplotlib legend handler for PolyCollection-based color artists, enabling gradient/colormap swatches to appear in legends. It is isolated from the rest of the package and can be reused in any Matplotlib project needing legend entries for non-standard artists.

file: src/cmasher/_handlercolorpolycollection.py β†— | tags: #matplotlib-legend-handler #custom-artist

Generates Tableau preferences files from CMasher colormap definitions, allowing the scientific colormaps to be used outside Python. This is a clean cross-application serialization pattern and could be adapted to export standardized colormap data to other tools.

file: src/cmasher/app_usage.py β†— | tags: #tableau-integration #config-export #cross-application

Provides the `cmr` command-line interface with subcommands for listing colormaps, viewing them, extracting colors, generating standalone colormap modules, and exporting to Tableau. It offers a compact, extensible model for building scientific-tooling CLIs on top of a Python library.

file: src/cmasher/cli_tools.py β†— | tags: #cli #argparse-subcommands #colormap-tooling
Last analyzed: 2026-10-22 16:53:20.778717
Next check: 2026-11-21 16:53:20.710668
$ submit: