Skip to main content

Library for text formatting in Unix-based systems

Project description

Colorfy Logo

Colorfy

Python Linux Windows macOS GitBook

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))

img_example1

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)

img_example2

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"))

img_example3


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colorfy_py-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colorfy_py-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

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

Hashes for colorfy_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c85928a100992bb9c8498aa4ed4a2717609f90774c136323f26a0cdb6a6d638
MD5 aa3741e636cbed9f29898f98a1aa5915
BLAKE2b-256 fe41973daa1d620c2b1cbd362865771e3ef0eb923c621d15ef93d40d5404d204

See more details on using hashes here.

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

Hashes for colorfy_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 664a4dd09c14ddc3f14f74041ad6f7681494f2b3ed7e7fc10a816ee6f8245b11
MD5 09cad3a7f462cf3e7e38456be89ebf23
BLAKE2b-256 f0e1e2ba01fc06ebf4da49db6235170107f5b159bdb6f1583c82f60d77c43e72

See more details on using hashes here.

Supported by

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