hexor
raw JSON → 0.0.15 verified Mon Apr 27 auth: no python
A Python library for coloring text and backgrounds in CLI using RGB or hex values. Current version: 0.0.15. Release cadence: irregular, occasional bugfix releases.
pip install hexor Common errors
error ImportError: cannot import name 'Hexor' from 'hexor' ↓
cause Older versions of hexor may have had a different API or the import path is incorrect.
fix
Ensure you have the latest version: pip install --upgrade hexor. Then use 'from hexor import Hexor'.
error TypeError: 'NoneType' object is not callable ↓
cause Calling hex() without instantiating Hexor, or using a method incorrectly.
fix
Create a Hexor object first: h = Hexor(); then call h.hex(text, color).
Warnings
gotcha The library may not be compatible with all terminals or environments. Test on your target terminal. ↓
fix Check documentation or source for compatibility details.
gotcha No explicit support for named colors; you must use hex or RGB values. ↓
fix Use hex (#RRGGBB) or 3-element list/tuple for RGB.
deprecated Version 0.0.x indicates pre-release. API may change without notice. ↓
fix Pin to a specific version in requirements.
Imports
- Hexor
from hexor import Hexor - Style
from hexor import Style
Quickstart
from hexor import Hexor
h = Hexor()
# Color text red using hex
print(h.hex('Hello, World!', '#ff0000'))
# Color background blue using rgb
print(h.rgb('Hello, World!', [0, 0, 255]))