palettes

palettes — Color math, wheels, cubes & swatch palettes.

palettes Color management library with RGB565 / RGB888 output, an HSV color wheel, RGB color cubes, Material Design swatches, and Win16 color names.

Live Pure-Python Device

Visual Palette Showcase

Live previews of generated palette spectrums and Material Design shade series.
Material Spectrum get_palette('material_design')
HSV Color Wheel get_palette('wheel')
RGB Cube Matrix get_palette('cube')
Windows-16 Standard get_palette('default')

Installation & API Usage

import mip
mip.install("palettes", index="https://PyDevices.github.io/mip")

# Example Usage:
from palettes import get_palette
palette = get_palette("material_design")
primary_color = palette.RED
shade_dark = palette.RED_S900

Changed in 0.0.14: the name tables (WIN16 and the cube tables) are ordered tuples of (0xRRGGBB, name) pairs, not dicts, so palette order is the same on CPython, MicroPython and CircuitPython. Code that looked a color up with WIN16[0xFF0000] or called .items() needs to change; the changelog has the details.

get_palette Options & Kwargs

Supports 16-bit RGB565, 24-bit RGB888, and byte-swapped hardware formats
Palette Name Description & Contents Useful Kwargs
"default" Windows-16 named colors (RED, BLUE, GREEN, CYAN, etc.) color_depth, swapped
"wheel" HSV color wheel as an indexed sequence length, saturation, color_depth, swapped
"cube" RGB color cube matrix size, color_depth, swapped
"material_design" Material swatches & 50–900 shade scales (RED_S100 through RED_S900) color_depth, swapped