rich-color-ext extends the great rich library to be able to parse 3-digit hex colors (ie. #09F) and CSS color names (ie. rebeccapurple).
Installation
uv (recommended)
# via uv directly
uv add rich-color-ext
or
# or via pip through uv
uv pip install rich-color-ext
pip
pip install rich-color-ext
Usage
To make use of rich-color-ext all you need to do is import and install it at the start of your program:
from rich_color_ext import install
from rich.console import Console
install() # Patch Rich's Color.parse method
console = Console(width=64)
console.print(
Panel(
"This is the [b #00ff99]rich_color_ext[/b #00ff99] example for printing CSS named colors ([bold rebeccapurple]rebeccapurple[/bold rebeccapurple]), 3-digit hex colors ([bold #f0f]#f0f[/bold #f0f]), and [b #99ff00]rich.color_triplet.ColorTriplet[/b #99ff00] & [b #00ff00]rich.color.Color[/b #00ff00] instances.",
padding=(1, 2),
),
justify="center",
)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rich_color_ext-2.0.0.tar.gz
(1.0 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rich_color_ext-2.0.0.tar.gz.
File metadata
- Download URL: rich_color_ext-2.0.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4f9c515dd893391c2a5b7b71275a67bffb87aab0b5c6232b65b93c6ea34d2a0
|
|
| MD5 |
40222c866d4a06294b9894c2b7933abf
|
|
| BLAKE2b-256 |
682b444f88192c7ea493950cfeccb0428cebe74fc38ba421c8ad974207e5c778
|
File details
Details for the file rich_color_ext-2.0.0-py3-none-any.whl.
File metadata
- Download URL: rich_color_ext-2.0.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbc48ea55a5b72a3800c5fa875ec71851f0e08531490ecf664917bcd5943385b
|
|
| MD5 |
5982a62ff14aec5412bf958e903a541b
|
|
| BLAKE2b-256 |
1728d31a4d8885e283d64c2632a5e11dc0f9f95dd60e7914bbe8b43302ebea4f
|