Color Palettes
Project description
wuncolors
Help manipulate Color objects and use custom Color Palettes.
Basic Usage
ColorPalette Object
Contains a hierachy of colors.
from wuncolors import ColorPalette
palette = ColorPalette.from_toml(full_path="palette_example.toml")
Primary
- blue(0, 0, 255, 1.0)
- red(255, 0, 0, 1.0)
Secondary
- random(100, 56, 1, 1.0)
- random2(222, 222, 7, 1.0)
Others
- white(255, 255, 255, 1.0)
from wuncolors import ColorPalette
palette = ColorPalette.from_toml(full_path="palette_example.toml")
blue = palette.get_primary("blue")
red = palette.all_colors("red")
all_primary = palette.get_primary()
all_secondary = palette.get_secondary()
all_colors = palette.all_colors()
print(all_primary)
[blue(0, 0, 255, 1.0), red(255, 0, 0, 1.0)]
Color objects
from wuncolors import Color
blue = Color.from_tuple(name="blue", rgb=(0, 0, 255))
Dynamic Usage
You can create a Palette from scratch and be save using the to_toml() method. Duplicate colors will be ignored if inserted in the same category. Colors are stored as sets in the palette.
from wuncolors import Color, ColorPalette
p = ColorPalette("Example")
p.primary.add(Color.from_tuple("blue", (0, 0, 255)))
p.secondary.add(Color.from_tuple("blue", (0, 0, 255)))
p.others.add(Color.from_tuple("blue", (0, 0, 255)))
p.to_toml("test_palette.toml")
ColorPalette(Example)
Primary
- blue(0, 0, 255, 1.0)
Secondary
- blue(0, 0, 255, 1.0)
Others
- blue(0, 0, 255, 1.0)
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
wuncolors-0.1.1.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wuncolors-0.1.1.tar.gz.
File metadata
- Download URL: wuncolors-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.5 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74efec581e5733db24227fc802a8a4f0c7f05b77eca588497b12542f09a49be3
|
|
| MD5 |
21cb0a2d252b9e0ece5b57967233b299
|
|
| BLAKE2b-256 |
9eaf5dc3117c17fd37d1c899af13e53ba85a8760a5b1d8ff12fd346adb5071dc
|
File details
Details for the file wuncolors-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wuncolors-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.11.5 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1e8445e8808cb02c7654c576e49ed6089b6076873df88d17f59bc872e4a5bce
|
|
| MD5 |
b04aec8fa7726809753e08e23c65e8be
|
|
| BLAKE2b-256 |
8dbee3c696e621aab522391fa4889397e4fcabcfebf074b2b39be8528c673643
|