Palette Gallery

August 29, 2026 · View on GitHub

A visual reference and interactive explorer for all built-in color palette families in palettes.

FamilyClassKeyPrimary Use Case
Color WheelWheelPalette"wheel"Continuous color ramps, hue sweeps, rainbows, circular gauges
Material DesignMDPalette"material_design"Modern UI widget theming, semantic status colors, contrast shades
Color CubeCubePalette"cube"Quantized 8, 27, 64, or 125 color spaces for dithering and Retro UIs
Windows-16Palette"default"Standard named 16-color ANSI/Windows retro palette

💻 Live Palette Explorer

Adjust the palette parameters below and click ▶ Run to see the colors render live in your browser:

Try changing name to "cube", "default", or "material_design"

palette = get_palette("wheel", color_depth=16, length=320, saturation=1.0)

Render a full-screen vertical sweep

for x in range(display.width): display.fill_rect(x, 0, 1, display.height, palette[x])

display.show() print(f"Rendered {len(palette)} colors from the wheel palette!")

Initializing Python…


1. Color Wheel ("wheel")

WheelPalette generates an evenly spaced rainbow ramp by stepping through HSV hues while maintaining constant saturation and value.

Color Wheel Preview

from palettes import get_palette

# 256-step wheel at full saturation
wheel = get_palette("wheel", color_depth=16, length=256, saturation=1.0)

# Access color at index
color_50 = wheel[50]

Parameters

  • length (int): Number of steps around the hue circle (default 256).
  • saturation (float): Color saturation between 0.0 (grayscale) and 1.0 (vibrant, default 1.0).
  • value (float): Brightness multiplier between 0.0 and 1.0 (default 1.0).
  • color_depth (int): Bit depth (16 for RGB565, 24 for RGB888, 32 for ARGB8888).
  • swapped (bool): If True, swap bytes in 16-bit RGB565 for SPI display hardware.

2. Material Design ("material_design")

MDPalette provides Google's Material Design color palette with 19 distinct color families, each containing shades from 50 (lightest) to 900 (deepest), plus accent shades (A100A700).

Material Design Preview

from palettes import get_palette

md = get_palette("material_design", color_depth=16)

# Shades are attributes: <FAMILY>_S<shade>, accents <FAMILY>_A<shade>.
header_bg = md.BLUE_S500  # 0x24BE -- primary brand color
card_bg   = md.BLUE_S50   # 0xE79F -- light tint background
accent_fg = md.BLUE_A400  # 0x2BDF -- vivid accent

Available Color Families

Attribute prefixes: RED, PINK, PURPLE, DEEP_PURPLE, INDIGO, BLUE, LIGHT_BLUE, CYAN, TEAL, GREEN, LIGHT_GREEN, LIME, YELLOW, AMBER, ORANGE, DEEP_ORANGE, BROWN, GREY, BLUE_GREY -- each with _S50.._S900 shades and (where Material defines them) _A100.._A700 accents; the bare family name (e.g. md.BLUE) is its 500 shade.


3. Color Cube ("cube")

CubePalette divides the RGB color space into equal steps along each axis (N×N×NN \times N \times N).

Color Cube Preview

Cube SizeTotal ColorsSteps per Channel (R, G, B)Typical Use
882 steps (0, 255)3-bit primary colors
27273 steps (0, 127, 255)Ultra-compact retro UIs
64644 steps (0, 85, 170, 255)6-bit color quantization
1251255 steps (0, 64, 128, 191, 255)High-fidelity dithering
# size is the steps per channel: size=4 -> 4x4x4 = 64 colors
cube = get_palette("cube", color_depth=16, size=4)

4. Named Windows-16 ("default")

The standard 16-color ANSI/Windows palette accessible by name or integer index.

Windows-16 Preview

from palettes import get_palette

win16 = get_palette("default", color_depth=16)

black  = win16.BLACK    # 0x0000
red    = win16.RED      # 0xF800
green  = win16.GREEN    # 0x0400
blue   = win16.BLUE     # 0x001F
yellow = win16.YELLOW   # 0xFFE0
white  = win16.WHITE    # 0xFFFF

win16[0]              # integer indexing works too -> 0x0000
win16.color_name(0)   # "Black"