Coloring texts and their backgrounds in command line interface (cli), with rgb or hex types.
Maintained. Last release over 3 years ago, commits in 12 of the last 26 weeks. Weaker on recent releases and release cadence.
pip install hexorColoring texts and their backgrounds in command line interface (cli), with rgb or hex types.
Maintained. Last release over 3 years ago, commits in 12 of the last 26 weeks. Weaker on recent releases and release cadence.
pip install hexor| Distribution | Version Check | Python Version | Supported | Status | Everything works |
|---|---|---|---|---|---|
| Ubuntu | Last version | 3.7 --> 3.11 | ✓ | ✓ | ✓ |
| Windwos | Last version | 3.7 --> 3.11 | ✓ | ✓ | ✓ |
| MacOS | Last version | 3.7 --> 3.11 | ✓ | ✓ | ✓ |
| Android-termux | Last version | 3.7 --> 3.11 | ✓ | ✓ | ✓ |
| Nethunter | Last version | 3.7 --> 3.11 | ✓ | ✓ | ✓ |
# install from pypi:
❯ pip install hexor
# local install:
❯ git clone https://github.com/yasserbdj96/hexor.git
❯ cd hexor
❯ pip install .
from hexor import hexor
# Usage example:
# p1 = hexor(return_option)
## return_option: [True, False]
### True to return results
### False to print results
## color_format: ['hex', 'rgb']
### 'hex' for hex colors (e.g., #ffffff, #cccccc)
### 'rgb' for rgb colors (e.g., (255, 255, 255), rgb(250, 12, 0))
# The default options are: hexor() = hexor(False)
p1 = hexor(<return_option>)
# To change text color only:
p1.c("<TEXT>", "<FOREGROUND>")
# To change text color and background together:
p1.c("<TEXT>", "<FOREGROUND>", "<BACKGROUND>")
from hexor import *
# Example:1
p1=hexor()
p1.c("Text is red","#ff0000")
p1.c("Text is red and background is blue","#ff0000","#1a73e8")
# Example:2
p2=hexor(True)
print(p2.c("Text is red","#ff0000"))
print(p2.c("Text is red and background is blue","#ff0000","#1a73e8"))
# Example:3
p3=hexor()
p3.c("Text is red","255,0,0")
p3.c("Text is red and background is blue","255,0,0","26,115,232")
# Example:4
p4=hexor(True)
print(p4.c("Text is red","255,0,0"))
print(p4.c("Text is red and background is blue","255,0,0","26,115,232"))
# Example:5
p5=hexor()
p5.c("Text is red","rgb(255,0,0)")
p5.c("Text is red and background is blue","rgb(255,0,0)","rgb(26,115,232)")
# Example:6
p6=hexor(True)
print(p6.c("Text is red","rgb(255,0,0)"))
print(p6.c("Text is red and background is blue","rgb(255,0,0)","rgb(26,115,232)"))
# Example:7
p7=hexor()
p7.c("Text is red and background is blue","rgb(255,0,0)","26,115,232")
p7.c("Text is red and background is blue","255,0,0","rgb(26,115,232)")
p7.c("Text is red and background is blue","rgb(255,0,0)","#1a73e8")
p7.c("Text is red and background is blue","255,0,0","#1a73e8")
# Example:8
hexor().c("Text is red","#ff0000")
hexor().c("Text is red and background is blue","255,0,0","rgb(26,115,232)")
# Example:9
print(hexor(True).c("Text is red","#ff0000"))
print(hexor(True).c("Text is red and background is blue","255,0,0","rgb(26,115,232)"))
Developer / Author: yasserbdj96
The content of this repository is bound by the following LICENSE.
If you enjoy this project and would like to see it continue to improve, or if you would like me to create more interesting projects, please consider sponsoring me.
website . github . gitlab . linkedin . twitter . instagram . facebook . youtube . pypi . docker . telegram . gitter . e-mail . sponsor
Use instead of hexor: tools that do the same job, closest first.
Compare with colored →Compare with termcolor →Compare with colorful →Compare all 4 →
Simple python library for color and formatting to terminal
ANSI color formatting for output in terminal
Terminal string styling done right, in Python.
ANSI colors for Python
Colorful worry-free console applications for Linux, Mac OS X, and Windows.
Cross-platform colored terminal text.