Skip to main content

DyePy

License: MIT

A Python module to work with anything related to colors.

From styling the text to changing the foreground and background colors to converting colors to and from different color spaces, or defaulting them to Hexadecimal codes/values (as most Python modules support or only accept HEX codes), this module can easily help you with ALL of it. And yeah, it even has CSS4 color support (like named colors with their respective Hex values and some added colors - which are famous or are used/seen a lot).

Detailed description/documentation for each and every class and function is written to make everything in the module understandable to every python developer. It is recommended to run this module - or a program this module is being imported in to be ran - on a command-line (like Bash, PowerShell, Command Prompt, etc.) for the module to work properly and give the most accurate and complete results (although results may vary with the command-lines, and some font styles may not work if they are not supported by the command-line)

Go to:

Installation

Install this package using the following command:

$ python -m pip install dyepy

The entire code in written in pure python, without any packages, so you don't require any internal/external packages to run/use this module. It is recommended to use the latest stable version of python (Python 3.9.0, as of 12/10/2020).

Usage (example)

You can either simply run the file to use its own mini command-line (kinda) using:

$ python dyepy.py

You'll either need to download dyepy or go to the installation folder and run the command from that folder

*[that folder]: print(__import__('dyepy').__file__)

Or you can simply copy/write this example program and run it:

# Import tkinter for demonstatration of colors
try:
    from Tkinter import Tk, Button  # Python 2

except (ModuleNotFoundError, ImportError):
    from tkinter import Tk, Button  # Python 3


# Import this module to the program
import dyepy


def change_bgcolor():
    """
    Changes the app background color and returns None
    """

    global root

    root.configure(background=dyepy.Colors.getrandomcolor())


root = Tk()
root.title('Usage (Example)')
root.configure(background=dyepy.Colors.BLACK)

button = Button(
    root, text='Change color',
    fg=dyepy.Colors.WHITE,
    bg=dyepy.Colors.WINDOWSBLUE,
    command=change_bgcolor,
    height=10, width=50
)

button.grid(row=0, column=0, pady=50, padx=250)

root.mainloop()

Save this python file (say, as example.py) and run it on a command-line using:

$ pythonw example.py

Meta

SFM61319 - u/SFM61319 - Avinash Maddikonda

Wanna contribute?

Everyone is welcome to update my documentation and/or the python code. And you are the 'one' in everyone.
To contribute, follow these steps:

  1. Fork it
  2. Create your feature branch by entering git checkout -b feature/fooBar on your Git Bash
  3. Commit your changes by entering git commit -m "Add some foo bar, baz"
  4. Push to the branch by entering git push origin feature/fooBar
  5. Create a new Pull Request (PR)

That's it, you have contributed to the documentation and/or the code!

If you have any major issues/doubts/feature requests or anything else which you don't want to do on your own or which you want to contribute without forking this repository, then please open an issue

Changelogs

Changelogs of the library can be found in CHANGELOGS.md

Once again, thank you for spending your precious time here, it means a lot to me!

Release files for dyepy 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dyepy 1.0.1
File Size Uploaded
dyepy-1.0.1.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dyepy 1.0.1
File Interpreter ABI Platform
dyepy-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / dyepy-1.0.1.tar.gz

Download URL dyepy-1.0.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
71ecd8755b580f304ff56730d1af68abaf4a2acc9ec61f1de137b91b874868de
BLAKE2b-256 checksum
How to use checksums
77b26157b3c8328afe9258f038a1afdeca0415377553bf031f4b5248cfe7e0ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Release files / dyepy-1.0.1-py3-none-any.whl

Download URL dyepy-1.0.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39a818ec7733630db6daa9458c77d4bd2b9dd2d9f7d7cbe467bdd9c422c86d07
BLAKE2b-256 checksum
How to use checksums
8470171a6e4b59a5b1dd36e1c5ae6d7f1f8e63bf12d92178a4de73a12b5b839f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page