Skip to main content

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.

Test on Ubuntu latest Test on Windows latest Test on MacOS latest pypi-setup Upload to PYPI Deploy static content to Pages CodeQL CodeFactor Supported Versions Visitors Open Source Stars Forks Watching GitHub contributors GitHub closed issues GitHub pull requests GitHub release (latest by date) GitHub commit activity GitHub last commit GitHub license Join the chat at https://gitter.im/yasserbdj96/hexor

Languages:

* python3

Supported 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 History

Development 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexor-0.0.15.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

hexor-0.0.15-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page