Module for using color in win command line or terminal.
Project description
MyColorsPy
About:
MyColorsPy - python`s module for using color in win command line or terminal.
Functional:
- Add color for text;
- Add style for text (works differently in different systems);
- Add user`s custom color for text (RGB format).
Screenshots:
example.py output.
How to use:
# import module
import MyColorsPy
# init Colors class
color = MyColorsPy.Colors()
# print red text
print(color.F_RED + "RED TEXT")
# clear formatting
print(color.S_CLEAR)
Using red color in output
- If not use S_CLEAR subsequent lines will also be colored red.
# import module
import MyColorsPy
# init Colors class
color = MyColorsPy.Colors()
# print custom color in rgb format (white)
print(color.custom(255, 255, 255, False) + "Hello world!")
# clear formatting
print(color.S_CLEAR)
Using custom color in output.
- You can use S_CLEAR in one line with output content to avoid a space along with clearing formatting.
custom(r, g, b, background)
Return custom rgb color in ascii format.
| Parameter | Type | Description |
|---|---|---|
r |
int |
red |
g |
int |
green |
b |
int |
blue |
bacground |
bool |
If equal True return custom background color, else if equal False return custom foreground color |
Preseted colors and styles
Colors
| Foreground | Bacground | Color |
|---|---|---|
F_BLACK |
B_BLACK |
Black |
F_BLUE |
B_BLUE |
Blue |
F_WHITE |
B_WHITE |
White |
F_PURPLE |
B_PURPLE |
Purple |
F_YELLOW |
B_YELLOW |
Yellow |
F_GREEN |
B_GREEN |
Green |
F_AQUA |
B_AQUA |
Aqua |
F_RED |
B_RED |
Red |
Styles
| Value | Description |
|---|---|
S_CLEAR |
Clear formatting |
S_BOLD |
Bold text |
S_PALE |
Pale text |
S_ITALIC |
Italic text |
S_UNDERLINE |
Underlined text |
S_FLASH |
Flashed text |
S_HIDE |
Hidden text |
S_CROSS |
Crossed text |
S_DOUBLEUL |
DoubleUL text |
S_FRAME |
Framed text |
S_SURROUND |
Surrounded text |
S_CROSSOUT |
Crossouted text |
P.S: Depending on the system, styles may or may not work.
Install:
pip install MyColorsPy
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
mycolorspy-0.1.1.tar.gz
(2.9 kB
view details)
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 mycolorspy-0.1.1.tar.gz.
File metadata
- Download URL: mycolorspy-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e8d0513c2fd732db6735fe69f1454fc890593aaede35940341014cb0e1e6703
|
|
| MD5 |
786337780e25ec46c7a94cf0fb40575f
|
|
| BLAKE2b-256 |
5c887f78c4680f1aa134644f115845599ac549532a8640fa217c6352dffd9ea0
|
File details
Details for the file MyColorsPy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: MyColorsPy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe883b82c22c9b245609867c2a804427d664a614cfc04543e88cdc34e5e830eb
|
|
| MD5 |
7c470086fe09aa8fafd73bbb677c849b
|
|
| BLAKE2b-256 |
0a3af9e27c2d1e17e0c41c1bb67e3ee9e48c32902e72748d223b0e33988141dc
|