Skip to main content

Rich Color Support

A Python library providing curated color palettes for rich terminal applications with descriptive color names.

Features

  • Multiple Color Sets: Choose from 8, 16, 32, 64, or the full palette of 200+ colors
  • Descriptive Names: Easy-to-remember color names like NAVY_BLUE, HOT_PINK, CHARTREUSE
  • Color Rotation: Built-in color rotator for cycling through colors without repetition
  • Rich Integration: Designed to work seamlessly with the Rich library

Installation

pip install rich-color-support

Quick Start

from rich_color_support import RichColors8, RichColors16, get_color_set, RichColorRotator
from rich.console import Console

console = Console()

# Use predefined color sets
console.print("Hello World!", style=f"color {RichColors8.RED}")
console.print("Colorful text!", style=f"color {RichColors16.CHARTREUSE}")

# Get a dynamic color set
colors = get_color_set(32)
for i, color in enumerate(colors):
    console.print(f"Line {i}", style=f"color {color}")

# Use color rotator for automatic cycling
rotator = RichColorRotator(8)
for i in range(20):
    color = rotator.pick()
    console.print(f"Message {i}", style=f"color {color}")

What's new in v0.2.0

Semantic colors and themes

from rich.console import Console
from rich_color_support import SemanticColors, dark_theme

console = Console(theme=dark_theme())
console.print("[success]Build passed[/]")
console.print(f"[{SemanticColors.ERROR}]Tests failed[/]")

Eight themes are available: default_theme, dark_theme, light_theme, high_contrast_theme, monochrome_theme, colorblind_theme (Okabe-Ito inspired), pastel_theme, monokai_theme. Use build_theme() for partial overrides.

Filter helpers

from rich_color_support import RichColors, filter_colors

dark_blues = filter_colors(RichColors, hue="blue", brightness="dark")
vivid_warm = filter_colors(RichColors, temperature="warm", saturation="vivid")

Preview and CLI

python -m rich_color_support preview --hue blue
python -m rich_color_support themes
python -m rich_color_support theme dark --demo

Color Sets

Class Colors Description
RichColors8 8 Essential high-contrast colors
RichColors16 16 Popular well-distinguished colors
RichColors32 32 Readable colors for rich interfaces
RichColors64 64 Professional colors for advanced apps
RichColors 200+ Complete palette of descriptive colors

Usage Examples

Basic Color Usage

from rich_color_support import RichColors16
from rich.console import Console

console = Console()

# Direct color usage
console.print("Error message", style=f"color {RichColors16.RED}")
console.print("Success message", style=f"color {RichColors16.GREEN}")
console.print("Warning message", style=f"color {RichColors16.YELLOW}")

Dynamic Color Selection

from rich_color_support import get_color_set

# Get exactly 10 colors
colors = get_color_set(10)

# Get colors for many items (returns full palette if > 64)
colors = get_color_set(100)

Color Rotation

from rich_color_support import RichColorRotator

# Create rotator with 16 colors
rotator = RichColorRotator(16)

# Colors won't repeat until all 16 are used
for item in my_items:
    color = rotator.pick()
    console.print(item, style=f"color {color}")

API Reference

Color Classes

All color classes inherit from RichColorsBase (which extends StrEnum):

  • RichColors8: RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN, WHITE, ORANGE
  • RichColors16: Adds BRIGHT_RED, DARK_GREEN, ROYAL_BLUE, GOLD, PURPLE, DARK_CYAN, LIGHT_CORAL, CHARTREUSE
  • RichColors32: Adds 16 more colors including NAVY_BLUE, HOT_PINK, VIOLET, SALMON
  • RichColors64: Adds 32 more professional colors
  • RichColors: Complete palette with 200+ descriptive color names

Functions

get_color_set(size: int) -> List[RichColorsBase]

Returns a color set of the specified size:

  • size <= 8: Returns subset of RichColors8
  • size <= 16: Returns RichColors16
  • size <= 32: Returns RichColors32
  • size <= 64: Returns RichColors64
  • size > 64: Returns complete RichColors palette

Classes

RichColorRotator(size: int)

A utility class for cycling through colors without repetition.

Methods:

  • pick() -> RichColorsBase: Returns next color in rotation, reshuffles when exhausted

Requirements

  • Python 3.11+
  • Rich 13.0.0+

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Links

Metadata

Release files for rich-color-support 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rich-color-support 0.2.0
File Size Uploaded
rich_color_support-0.2.0.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rich-color-support 0.2.0
File Interpreter ABI Platform
rich_color_support-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.1 kB

Release files / rich_color_support-0.2.0.tar.gz

Download URL rich_color_support-0.2.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
02e1966084839c84a1ba9ae72eef749842589172bc21d39fe3ec7598441d8ad2
BLAKE2b-256 checksum
How to use checksums
0fea16340d6bf94870fef945769acc82b1ab8a1bf5fe7c9f23558a0c19ae8b94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.13 Darwin/25.3.0

Release files / rich_color_support-0.2.0-py3-none-any.whl

Download URL rich_color_support-0.2.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df1198cc7275bb2ecf0605aabae508bb79dd47ff9793d97c993383da41fa73e9
BLAKE2b-256 checksum
How to use checksums
7a1b64be4e7f56b4ed1c4f0bf79b21cbecd8665d302adca8b977be3ae9bf9528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.11.13 Darwin/25.3.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page