Skip to main content

A Python module for all colors and related functions

Project description

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!

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

dyepy-1.0.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dyepy-1.0.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file dyepy-1.0.1.tar.gz.

File metadata

  • Download URL: dyepy-1.0.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for dyepy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 71ecd8755b580f304ff56730d1af68abaf4a2acc9ec61f1de137b91b874868de
MD5 e43eb9f1c4ab466d7c82fc1ac4b585db
BLAKE2b-256 77b26157b3c8328afe9258f038a1afdeca0415377553bf031f4b5248cfe7e0ff

See more details on using hashes here.

File details

Details for the file dyepy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dyepy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for dyepy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39a818ec7733630db6daa9458c77d4bd2b9dd2d9f7d7cbe467bdd9c422c86d07
MD5 18616a3f3f7596527ea2d5f4fb6e2840
BLAKE2b-256 8470171a6e4b59a5b1dd36e1c5ae6d7f1f8e63bf12d92178a4de73a12b5b839f

See more details on using hashes here.

Supported by

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