Terminal text coloring with RGB and multi-stop gradients in Python.
Features
- Color text using truecolor (24-bit) or 256-color approximation
- Multi-stop gradient text with smooth interpolation
- Reusable factory classes for fast generation
- Animated gradients with time-based looping
- Pure Python — only depends on
numpy
Installation
pip install rgbterminal
Usage
Basic RGB Text
from rgbterminal import RGBText
text = RGBText("Hello World!", rgb=(255, 0, 0), truecolor=False)
print(text)
RGBTextFactory
from rgbterminal import RGBTextFactory
factory = RGBTextFactory(rgb=(0, 128, 255), truecolor=False)
text1 = factory.t("Hello")
text2 = factory.t("World")
print(text1, text2)
Gradient Text
GradientText allows you to apply a smooth gradient across a string using multiple color stops.
Multi-stop Gradient Example
from rgbterminal import GradientText
gradient = GradientText(
"Gradient Example",
rgb_stops=[(255, 0, 0), (255, 255, 0), (0, 255, 0), (0, 0, 255)],
truecolor=False
)
print(gradient)
- Supports any number of RGB stops.
- Interpolates colors in HLS space for smooth transitions.
- Works with both truecolor (24-bit) and 256-color terminals.
GradientTextFactory
from rgbterminal import GradientTextFactory
factory = GradientTextFactory(rgb_stops=[(255,0,0), (0,0,255)], truecolor=False)
text = factory.t("Hello Gradient!")
print(text)
- Factory allows you to reuse the same gradient multiple times.
- You can override stops per call if needed.
Animated Gradients
The new animated_gradient_print function animates a smooth, cyclic gradient across text in real time — perfect for banners, CLI logos, or loading indicators.
import time
from rgbterminal import GradientText, animated_gradient_print
gradient = GradientText(
"Animated RGB Terminal!",
rgb_stops=[(255,0,0), (255,255,0), (0,255,0), (0,255,255), (0,0,255)],
truecolor=False
)
animated_gradient_print(gradient, duration=5, fps=30, speed=1.0, resolution=12)
License
MIT License
Metadata
Release files for rgbterminal 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rgbterminal-0.3.0.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rgbterminal-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / rgbterminal-0.3.0.tar.gz
| Download URL | rgbterminal-0.3.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d9486480f077b371e66ddb5fb9daece5cfff3c2dc257031c0d577efae8c552a
|
|
BLAKE2b-256 checksum How to use checksums |
134294310765f65aa98871129177a4775b6eb1d754fb7eb5ec2fda7e414f1252
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / rgbterminal-0.3.0-py3-none-any.whl
| Download URL | rgbterminal-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0dc71404675467858c175d3d2174dc79816f28e2e591ca839e8018a715f67ab
|
|
BLAKE2b-256 checksum How to use checksums |
8bdb666d7519b4cfda5c2e51ace1f1dcf367813644a6390201a64521d7ff9877
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|