Coloring texts and their backgrounds in command line interface (cli), with rgb or hex types.
Project description
hexor
Coloring texts and their backgrounds in command line interface (cli), with rgb or hex types.
Languages:
* python3Supported Distributions:
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 | ✓ | ✓ | ✓ |
Python Package Installation:
# install from pypi:
❯ pip install hexor
# local install:
❯ git clone https://github.com/yasserbdj96/hexor.git
❯ cd hexor
❯ pip install .
Script Usage:
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>")
Script Examples:
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)"))
Screenshot:
Changelog History:
Click to See changelog HistoryDevelopment By:
Developer / Author: yasserbdj96
License:
The content of this repository is bound by the following LICENSE.
Support:
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
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
File details
Details for the file hexor-0.0.15.tar.gz
.
File metadata
- Download URL: hexor-0.0.15.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edf0d43115d6f02b858b0531d67b997348fa6f6d93d3c83e83b392b8d8cec1ba |
|
MD5 | ffd29d6367fda04380f761ef487c5e56 |
|
BLAKE2b-256 | c1c3795e1ce53497e3bf41540fea2b5e6b7aa07aad6887ea0f5d19702d101b6a |
File details
Details for the file hexor-0.0.15-py3-none-any.whl
.
File metadata
- Download URL: hexor-0.0.15-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa24f03b2c318a890122080d78bb0343dcf879302a4163503e8339bf42d268c9 |
|
MD5 | 070d1185221ea33b0b32387d67dbda4e |
|
BLAKE2b-256 | 5e50604c89858a3559f70db4dcc331516405b38db950ad2a9621c7ccb19e055a |