Skip to content

SwezyDev/hexstyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

standard(2)

PyPI Python Telegram
PyPI
Leave a ⭐ if you like this repository


🚩 What is hexstyle?

hexstyle is a tiny, dependency-free Python package that lets you print colored text in your terminal using HEX color codes — just like in web design. It's simple, lightweight, and supports every imaginable color with easy-to-use helper functions.


🚀 Installation

Install from PyPI:

pip install hexstyle

PyPI: https://pypi.org/project/hexstyle/


🧩 Quick usage

import hexstyle

print(hexstyle.set("#ff0000") + "Hello, world!" + hexstyle.reset())

hexstyle.set(hex: str)

  • hex: the hex color you want to use

📚 Features

  • Use any HEX color to style your terminal text
  • Lightweight & dependency-free — pure Python
  • Works on most modern terminals (Windows, macOS, Linux)

⚠️ Notes & Limitations

  • ANSI color codes may not display correctly in environments that don't support truecolor (24-bit) — for example, some older Windows terminals or minimal Docker shells.
  • Output colors may vary slightly depending on your terminal theme or emulator.
  • This package only affects terminal (stdout) text — it won’t color text in log files or GUI applications.
  • Unicode/emoji characters work fine, but truecolor accuracy may vary between fonts or shells.

🧪 Examples

A short interactive example:

import hexstyle

print(hexstyle.set("#ff0000") + "Hello, world!" + hexstyle.reset())
input(hexstyle.set("#00ff00") + "How are you today?: " + hexstyle.set("#0000ff"))

🆘 Quick Fix

  • If you see weird formatting like ←[38;2;255;0;0mHello, world!←[0m, try clearing the terminal (cls on Windows, clear on Linux/macOS) or switching to a terminal that supports ANSI colors.

📦 Where to get help


📝 License

Distributed under the MIT License — see LICENSE for details.


👤 Maintainer & Contact


Made with ❤️ — If you find this useful, please leave a ⭐ on the repo

Star History Chart