A lightweight Python package that lets you print text in any imaginable color using HEX codes
Project description
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 (clson Windows,clearon Linux/macOS) or switching to a terminal that supports ANSI colors.
📦 Where to get help
- Project on PyPI: pypi.org/project/hexstyle/
- Telegram: @Swezy
📝 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
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 hexstyle-1.1.1.tar.gz.
File metadata
- Download URL: hexstyle-1.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45b6df7cee27f47f31b8a37649c2123fdcd0f6816ef2aafe1864fba766bb99b0
|
|
| MD5 |
fbb3789277339da1fe5623f9ed8e4dbb
|
|
| BLAKE2b-256 |
51eb2c6986af85f8767918ae012b4e4d16ab5cc255b852432663033f821a6c78
|
File details
Details for the file hexstyle-1.1.1-py3-none-any.whl.
File metadata
- Download URL: hexstyle-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f618223d533535f07a5b89416d5b47350493e45ee2162489b6193f38144c66d
|
|
| MD5 |
723ca6f2bd1a5f9fb1c02afeec668699
|
|
| BLAKE2b-256 |
340123cc6800e3c40089a98c44123e4f16ee523067b4cc6b882069c7aa080c37
|