skillfed

distinctipy

A lightweight package for generating visually distinct colours.

distinctipy v1.3.4 207.0K downloads/30d#9,558 on PyPI293
Permissive 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) DORMANT released

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 distinctipy

uv

uv add distinctipy

poetry

poetry add distinctipy

Installing 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

Framework :: MatplotlibLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Multimedia :: GraphicsTopic :: Scientific/Engineering :: VisualizationTopic :: Utilities

Tags

generate distinct colorscolor palette generationvisually distinct colorscolormap creationcolorblind-friendly colorscolor distance algorithmmany colors palette
color-generationvisualizationaccessibility

More Utilities packages