Simple addition of color to the builtin print and input functions
Project description
colorez
Simple addition of color to the builtin print and input functions
Installation
Simply run pip install colorez
. The PyPI package is at https://pypi.org/project/colorez/
Example Usage
from colorez import color_print, Color, color_input, line_print, object_print, style, print_gradient
# color and styles added to builtin print
color_print("This is red", color="red")
color_print("This is gold and bold", color=178, bold=True)
color_print("This is pink with white background", color="#ed0ecc", bg_color="white")
# stylized text as objects for terminal output
print(Color("hi", 23, ["1", "2"], color="blue"), Color(0, 0, 255, color="plum"))
print("No color", Color(1, 2, 3, color="green"), "\t", Color("orange and italic", color="orange", italic=True))
# Choose style of the prompt for inputs
color_input("yellow and underlined>", color="yellow", underline=True)
# Rewrite lines with the same identifier
line_print("Starting")
line_print("Status: working", identifier="status", color="green")
line_print("Status: broken", identifier="status", color="red")
# Highlight types of objects
object_print({"foo": "bar"}, str_color="green", num_color="red")
object_print([1, 2, 3], str_color="green", num_color="red")
# Use style decorators to change all prints in a function
@style(color="green")
def my_function():
print("this will be green")
print("these green too", 2, [], {"foo": "bar"})
color_print("this will be red", color="red")
my_function()
# Print with a gradient
print_gradient("This will print from red to blue", start_color="red", end_color="blue")
view_color_names()
test_terminal_color_set()
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
colorez-1.1.4.tar.gz
(14.2 kB
view details)
Built Distribution
colorez-1.1.4-py3-none-any.whl
(13.6 kB
view details)
File details
Details for the file colorez-1.1.4.tar.gz
.
File metadata
- Download URL: colorez-1.1.4.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53ec1400f18758d6ab0c42e8c6c3ff2d7563472ecf7b511da8219ff983126f25 |
|
MD5 | 6ddb5c02c00e4154b7e7bb5ba442a834 |
|
BLAKE2b-256 | 38c9cfd67ca664af660beef7205058cfa43d35971a6330c2bb628225196370f9 |
File details
Details for the file colorez-1.1.4-py3-none-any.whl
.
File metadata
- Download URL: colorez-1.1.4-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de5200a9ec2f7de7b391de7a49d0a70a7884dca6be2f179c93323c9ac7fb643 |
|
MD5 | 7ac8a3a5808a82a95287fc9f649beb47 |
|
BLAKE2b-256 | c9cdc4b61f38c2cd625afd7951c3b93165e64fc0e2146ef1d0cb272ae8ede794 |