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.2.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.2.tar.gz.
File metadata
- Download URL: wuncolors-0.1.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.0 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db2f98f21c718b6c49e48b2599694cc52ec8c54b696ecb8785567b36d696c4f8
|
|
| MD5 |
5908552264605a23332a69eccc1711f0
|
|
| BLAKE2b-256 |
3c36134fc946ca4c4f59c12549bf13392f3208d16b33793be77d8f216f7d87ad
|
File details
Details for the file wuncolors-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wuncolors-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.0 Darwin/21.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0da82e0694f738ea1de95055f2d868a58634d537e5385a3c67c82caf6326d351
|
|
| MD5 |
dabe683c47c0abd0a0f6656a64b093f9
|
|
| BLAKE2b-256 |
44acf908b28fc1be0e617883f848cc02edfad35986bfccbb79b580ccd6429f63
|