A simple Python module for adding colors to text in the terminal
Project description
Terminal-Colorify
Terminal-Colorify is a simple and powerful python library to color your terminal output easily with RGB, gradients, rainbows, backgrounds, flashing text, themes, and more.
Installation
pip install Terminal-Colorify
Features
Set text color using RGB or predefined names
Set background color
Bold and underline styles
Generate random colors
Create gradient colored text
Create rainbow colored text
Flash text between two colors
Animated progress bar
Built-in themes (warning, success, info, error, etc.)
Usage
from colors import Colors
import time
# Set a named color
print(Colors.set_color(color="green", text="Green Text", bold=True, underline=True))
# Set a custom RGB color
print(Colors.set_color(rgb=(255, 0, 0), text="Custom Red"))
# Random color
print(Colors.set_color(color=Colors.random_color(), text="Random Color Text"))
# Gradient text
print(Colors.gradient_text("Gradient Text", (255, 0, 0), (0, 0, 255)))
# Rainbow text
print(Colors.rainbow_text("Rainbow Text!"))
# Flashing text
color = Colors()
color.flash_text("Flashing Text!", color1="red", color2="blue", times=5, delay=0.5)
# Progress bar
for i in range(101):
color.progress_bar(i, color="green")
time.sleep(0.05)
print()
# Apply a theme
print(Colors.apply_theme("success"))
# List all themes
Colors.list_themes()
Available Themes
warning ג€” Yellow text with red background
info ג€” Cyan text
success ג€” Green bold text
error ג€” Red bold underline text
neutral ג€” White text with gray background
dark, light, ocean, coolblue, sunset, mint and more
License
This project is open source and available under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 Terminal-Colorify-1.1.0.tar.gz.
File metadata
- Download URL: Terminal-Colorify-1.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39afb8817fc47b280e2e44664b9d41cf5e769cf5cf3e0886def828eab7bbe06
|
|
| MD5 |
652c81eb6e5e187edf0593348db54ce5
|
|
| BLAKE2b-256 |
1489e93de69b25f0e432b5c1593cd748eea7b1ed2e27d725813e2fed312e0278
|
File details
Details for the file Terminal_Colorify-1.1.0-py3-none-any.whl.
File metadata
- Download URL: Terminal_Colorify-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77b3a2cdc0743046856e6668a28b1892d91985d9b6d4def5dd802f4fece2070f
|
|
| MD5 |
e0fe3403e2ce3ab8473db85482541fec
|
|
| BLAKE2b-256 |
0dbecd7c13a37ab4525313d4cb90d77647c24d73f28091cfe50a1ded3f2d385c
|