Library for text formatting in Unix-based systems
Project description
Colorfy
Colorfy is a Python library for text-formatting in the console. You can use it on Unix-based systems, such as Linux and macOS, and on Windows.
Installation
pip install colorfy- Download the file called colorfy from include folder.
Warning
Warning: Some features could not be used in Windows, for example Windows does not support Stylist's features such as BOLD style (other probably work). Info: To enable Stylist's features in Windows Console you have to initialize colorfy:
from colorfy import Colorfy
Colorfy.init()
I have been using Alpine Linux, for showcase, so I did not use colorfy initialization
Features
- Color support: Use HEX color codes or RGBA tuples to apply colors to text.
- Pre-defined color palettes: Includes basic colors and themed palettes (e.g., Catppuccin, Dracula and Solarized themes).
- Text styling: Bold, italic, underline and strikethrough.
Showcase
Custom colors
from colorfy import Colorfy
#applying HEX color
some_color = Colorfy("#FF5733")
print(some_color.apply("Some color | example 1 " + some_color.hex))
#applying color using RGBA
another_color = Colorfy((255, 200, 133, 255))
print(another_color.apply("Some color | example 2 " + another_color.hex))
Stylist
from colorfy import Stylist, Palette
print(Stylist.BOLD + "Hello world" + Stylist.RESET)
print(Stylist.ITALIC + "Hello World" + Stylist.RESET)
print(Stylist.STRIKETHROUGHT + "Hello world" + Stylist.RESET)
print(Stylist.UNDLINE + "Hello World" + Stylist.RESET)
# I called it .SWAP cuz it swaps "apply" func's target layer to bg
print(Stylist.SWAP + Colorfy(Palette.RED).apply("Hello World") + Stylist.RESET)
Palette
from colorfy import Colorfy, Palette
print(Colorfy(Palette.Catppuccin.Latte.TEAL).apply("██ # TEAL"))
print(Colorfy(Palette.Catppuccin.Latte.SKY).apply("██ # SKY"))
print(Colorfy(Palette.Catppuccin.Latte.SAPPHIRE).apply("██ # SAPPHIRE"))
TODO
- Make color blending, so Alpha will not be useless argument
- Refactor some parts
- Add EMOJI class to print emojis in Console
- Add gradient functions same as in venaxyt/fade library, but also make it flexible, so you can create your own fade colors
- Add GitBook documentation
P.S.
If you have any questions or ideas for this library, feel free to ask. My discord: antisssocial_
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
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 colorfy_py-0.1.0.tar.gz.
File metadata
- Download URL: colorfy_py-0.1.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c85928a100992bb9c8498aa4ed4a2717609f90774c136323f26a0cdb6a6d638
|
|
| MD5 |
aa3741e636cbed9f29898f98a1aa5915
|
|
| BLAKE2b-256 |
fe41973daa1d620c2b1cbd362865771e3ef0eb923c621d15ef93d40d5404d204
|
File details
Details for the file colorfy_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: colorfy_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
664a4dd09c14ddc3f14f74041ad6f7681494f2b3ed7e7fc10a816ee6f8245b11
|
|
| MD5 |
09cad3a7f462cf3e7e38456be89ebf23
|
|
| BLAKE2b-256 |
f0e1e2ba01fc06ebf4da49db6235170107f5b159bdb6f1583c82f60d77c43e72
|