distinctipy
A lightweight package for generating visually distinct colours.
What it is and what it does
distinctipy generates palettes of many visually distinct colors by iteratively adding each new color to maximize perceptual distance from existing ones in the palette. It wraps a color distance metric and provides utilities to work with the generated colors: converting them to matplotlib colormaps, selecting contrasting text colors for backgrounds, inverting colors, and simulating how they appear to people with different types of colorblindness.
The package is designed for applications that need more than the typical 20 colors available in standard qualitative colormaps. It depends only on numpy at runtime, making it lightweight to install. Optional dependencies (matplotlib, pandas) are needed only for visualization and examples. The code is stable and dormant rather than actively maintained, but suitable for the straightforward task it performs.
Use it for:
- Generate a large color palette for a visualization with many categories or clusters that need distinct colors.
- Create a colormap for matplotlib plots when standard qualitative colormaps don't have enough distinct colors.
- Design interfaces or dashboards where many data series or groups must be color-coded and easily distinguishable.
- Simulate how a visualization appears to someone with colorblindness (e.g., Deuteranomaly) to ensure accessibility.
- Select a contrasting font color (black or white) automatically for any given background color in a UI.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates lists of visually distinct colors of any length, with each new color maximally different from existing ones, and provides utilities to work with those colors including colorblind simulation.
Yes, if you need to generate many visually distinct colors or work with color palettes programmatically. The package is lightweight, has no security vulnerabilities, and solves a specific problem well. Dormant maintenance is acceptable here because the core algorithm is stable and the package has no complex dependencies. Not necessary if you only need standard matplotlib colormaps or a small fixed palette.
Install
distinctipy on PyPI
pip
pip install distinctipyuv
uv add distinctipypoetry
poetry add distinctipyInstalling distinctipy
Before you install
Low friction: pure Python wheel with only numpy as a runtime dependency. Maintenance is dormant (last release 2024-01-10, 947 days ago), but the repository is not archived and has 293 stars; suitable for stable utility code that doesn't require active development.
License in practice
MIT License permits unrestricted use, modification, and distribution with only attribution and liability disclaimer required—no restrictions on commercial or private use.
Quickstart
pip install distinctipy
import distinctipy
colors = distinctipy.get_colors(36)
print(colors)
Requires Python 3.8 or later. Optional: matplotlib and pandas needed only if using color_swatch() or other visualization functions.
Verify before relying
- Whether the color distance metric and distinctness algorithm remain state-of-the-art or have been superseded by newer research.
- Real-world accuracy of colorblind simulation across different types of color vision deficiency.
Package facts
| License | MIT License Copyright (c) 2019 The Alan Turing Institute Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | dormant — 947 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 207,042/month — #9,558 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: distinctipy-1.3.4-py3-none-any.whl
Keywords: color, colour, palette, colormap, colorblind, colourblind
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
colourmapGenerates unique RGB and HEX colors from input…
permissive · top 15,000 on PyPI
colorthiefExtracts dominant colors and color palettes…
permissive · top 15,000 on PyPI
colorcetColorcet provides a collection of perceptually…
unclear · top 5,000 on PyPI
cmapcmap provides a collection of scientific…
permissive · top 15,000 on PyPI
cmcrameriProvides perceptually uniform colormaps by…
permissive · top 15,000 on PyPI
palettablePalettable provides a library of color palettes…
permissive · top 5,000 on PyPI
colorspaciousConverts colors between standard and…
permissive · top 15,000 on PyPI
cmweathercmweather provides a collection of colormaps…
permissive · top 15,000 on PyPI
brewer2mplProvides access to all 165 ColorBrewer2.org…
permissive · top 15,000 on PyPI
colour-scienceColour provides algorithms and datasets for…
permissive · top 15,000 on PyPI