Skip to main content

A python collection of functions to print of colored text to console / terminal.

Project description

A python collection of functions to print of colored text to console / terminal.


Installation

With git GitHub:

git clone https://github.com/IrtsaDevelopment/PyTermColor.git

Or with pip PyPi

pip install idev-pytermcolor






Usage

To import:

from PyTermColor.Color import *

Then, later on you may utilize:

printColor(text: str, textColor: str, backgroundColor: str = None, decorations: list | str = [], end: str = '\n')
# Prints off text and background in the given color with provided decorations.

printRGBColor(text: str, textRGB: tuple, backgroundRGB: tuple = (), decorations: list | str = [], end: str = '\n')
# Prints off text and background in the given rgb value with provided decorations.


showColorList()
# Prints off a list of valid arguments for color.

showDecorationList()
# Prints off a list of valid arguments for decoration.



Code Examples

from PyTermColor.Color import *

printColor('hello', 'red')
from PyTermColor.Color import *

printColorRGB('hello', (100, 200, 50))
from PyTermnColor.Color import *

printColor('hello', 'red', decorations = 'bold')
printColor('hello there', 'red', decorations = ['bold', 'underline'])

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

idev-pytermcolor-1.0.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

idev_pytermcolor-1.0.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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