Personal font color utility library for Python
Project description
zyjared-color
Personal font color utility library for Python, primarily used in PowerShell.
Installation
pip install zyjared-color
Usage
Basic Usage
Create a styled text using the Color
class:
from zyjared_color import Color
text = Color('Hello World!').red().bold()
print(text)
You can achieve the same result using ColorStatic
class methods:
from zyjared_color import ColorStatic as Colors
text = Colors.red('Hello World!').bold()
print(text)
Or using convenience functions for styles:
from zyjared_color import red, bold, italic
text = red('Hello World!').bold()
print(text)
text = italic(text)
print(text)
Chaining Usage
You can chain multiple style methods together:
from zyjared_color import red
text = red('Hello World!').bold().italic().underline().through()
print(text)
Nested Usage
Combine different styling methods and functions:
from zyjared_color import red, bold, italic, underline, through, blue
text = through(underline(italic(bold(red('Hello World!')))))
print(text)
# add more text
text = text + ' !!! ' + blue('Hello World!')
print(text)
# change text color
text.yellow()
print(text)
All Styles
You can view all styles through the ColorStatic
class method.
styles
bold
dim
italic
underline
through
reverse
blink
blink_fast
hidden
frontground
black
red
green
yellow
blue
magenta
cyan
white
bright_black
bright_red
bright_green
bright_yellow
bright_blue
bright_magenta
bright_cyan
bright_white
background
bg_black
bg_red
bg_green
bg_yellow
bg_blue
bg_magenta
bg_cyan
bg_white
bg_bright_black
bg_bright_red
bg_bright_green
bg_bright_yellow
bg_bright_blue
bg_bright_magenta
bg_bright_cyan
bg_bright_white
HTML / CSS
from zyjared_color.html import ColorHTML
text = ColorHTML('Hello World!').red().bold()
print(text)
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
zyjared_color-0.4.0a7.tar.gz
(8.0 kB
view details)
Built Distribution
File details
Details for the file zyjared_color-0.4.0a7.tar.gz
.
File metadata
- Download URL: zyjared_color-0.4.0a7.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.1 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5c8e11987335bc779327567049b0504916fb4611cf28f1171a8decb5a2b4667 |
|
MD5 | db6fa2706650f9d6a8bc8a6a691e5dac |
|
BLAKE2b-256 | f8a735f0aa8716f4d8d9fe132cb59607a1bf717c021135b542c9a4a318332b75 |
File details
Details for the file zyjared_color-0.4.0a7-py3-none-any.whl
.
File metadata
- Download URL: zyjared_color-0.4.0a7-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.1 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98c4b731de6241fb1b7a8f432c9e85dc28694dcd2fb13136ca3338dbbdb6def8 |
|
MD5 | d96df175e229b273c0e39451f7d58935 |
|
BLAKE2b-256 | 527e7d5e507cec001e2b520b0f8ed92bc5641d8a131777d2d8b5a2578763ef8a |