Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Terminal-Colorify-1.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Terminal_Colorify-1.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file Terminal-Colorify-1.1.1.tar.gz.

File metadata

  • Download URL: Terminal-Colorify-1.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for Terminal-Colorify-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d09785c6190d2c3d9efadfa45688a205fe4d313852f548ffb4ed9ba0ef43030d
MD5 1f4d6aad4e66ce139174a257d1abdaef
BLAKE2b-256 89d8e5ce3a754eccaf839fec15176320e5fdbf3cf0090b78ddcdd6e339caa441

See more details on using hashes here.

File details

Details for the file Terminal_Colorify-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Terminal_Colorify-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a8b11218e024f8cfa4d599e2fb0a9367d3bae2f6596cc4de642e4fd1ef9e40
MD5 ffb26e39ce780edc570bc143a8fc5593
BLAKE2b-256 cbcbb08535781ca8b0dccd8772f5d71a7a9cd5cec5069234e96d15e0ec42c877

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page