You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently RazTint only supports the 16 standard ANSI colors. Add optional, zero‑dependency support for extended colors: 24‑bit True Color and 256‑color mode via raw ANSI escape sequences.
Proposed API
fromraztintimportrgb, hex_color, color256fromraztintimportbg_rgb, bg_hex_color, bg_color256# True Color foregroundprint(rgb("This is orange text", 255, 100, 50))
print(hex_color("Same orange via hex", "#FF6432"))
# True Color backgroundprint(bg_rgb("Orange background", 255, 100, 50))
# 256-colorprint(color256("Orange via 256 palette", 208))
print(bg_color256("Background 256", 208))
# Seamless composition with existing stylesprint(bold(rgb("Bold green text", 0, 200, 0)))
print(rgb(bg_color256("White text on orange bg", 208), 255, 255, 255))
Acceptance criteria
Zero dependencies – only stdlib escape codes
All new functions follow the pattern func(text, *color_params) → str
Feature request
Currently RazTint only supports the 16 standard ANSI colors. Add optional, zero‑dependency support for extended colors: 24‑bit True Color and 256‑color mode via raw ANSI escape sequences.
Proposed API
Acceptance criteria
Zero dependencies – only stdlib escape codes
All new functions follow the pattern func(text, *color_params) → str
ANSI sequences: \033[38;2;R;G;Bm (foreground), \033[48;2;R;G;Bm (background)
256‑color: \033[38;5;INDEXm / \033[48;5;INDEXm
Respect NO_COLOR, RAZTINT_FORCE_COLOR, and terminal detection
Works with existing styling functions (bold, underline, etc.)
Backward compatible – doesn’t break red(), bg_blue(), etc.
Background color resets use \033[49m to preserve foreground styles
Unit tests for each new function
README updated with an “Extended Colors” section
New code passes project tooling:
black src tests,ruff check src tests, andty check src