A python package for easy management of colors and palettes.
Project description
What is colorir?
colorir is a package developed to unify your workflow with colors across different projects.
With colorir you can:
Create palettes of your favorite colors to use in your different projects;
Pass color values directly as input for other graphical or web frameworks;
Have access to a curated selection of unique color palettes and color names;
Easily convert between different color systems and formats;
Create gradients between colors and sample from them;
Easily visualize swatches of colors in the terminal;
And much more!
colorir was designed to be your best friend when dealing with colors so that you won’t ever need to write this kind of code again:
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
CSS_ALICEBLUE = (240, 248, 255)
COOL_PURPLE = (11, 0, 51)
MY_FAVORITE_GREEN = (113, 180, 141)
TOP_NOTCH_RED = (131, 34, 50)
# ... unnecessarily long and ugly list of colors
Getting Started
Getting started with colorir can be as simple as:
sky = Palette.load("sky") # Loads the sky palette
sky_grad = PolarGrad([sky.sunrise, sky.highnoon]) # Creates a gradient from "sunrise" to "highnoon"
swatch(sky) # Shows colorir objects in the terminal
swatch(sky_grad)
This code should print both the palette and the gradient directly in your terminal:
Now let’s see how colorir can be used along other frameworks!
import tkinter as tk
colors = Palette.load() # Load colors
win = tk.Tk()
win.configure(bg=colors.magicmint) # Set background to 'magicmint' color
win.mainloop()
The power of colorir comes from the fact that you can adjust it to work seamlessly with almost any graphical or web framework, not only tkinter!
For more information (including use-cases and examples), see colorir’s documentation here.
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 colorir-1.3.14.tar.gz
.
File metadata
- Download URL: colorir-1.3.14.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ff2d96de853e11001714f03a4a0d11569b362094e976f431efb6ee75a593738 |
|
MD5 | 9c2cdc1dc579a2a4efc324113978a14a |
|
BLAKE2b-256 | 44db3b53418ac6badad67ec523a4dc21fa34159ac96c326972be47aaba5d40cd |
File details
Details for the file colorir-1.3.14-py3-none-any.whl
.
File metadata
- Download URL: colorir-1.3.14-py3-none-any.whl
- Upload date:
- Size: 52.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9754e718289af730f8228593935b631d24a495adbb2bbc67fb3740a9521e2d24 |
|
MD5 | 292e7ad18d4cb538f89ff97992935fcf |
|
BLAKE2b-256 | 2ed25c4706df922bf9abbaba1da41382a7ab74e3585800e2a752d86c5ca51f07 |