Beautiful palettes in Python
Project description
Pylettes
v0.2.0
pylettes
is a lightweight matplotlib
-compatible collection of beautiful palettes for Python 3.
See all currently available palettes here.
Installation
pylettes
can be easily installed with PiPy
pip install pylettes
.
To install the latest (unreleased) version you can download it from this repository by running
git clone https://github.com/fcomitani/pylettes
cd pylettes
python setup.py install
The only requirement is matplotlib >= 1.3.1
.
Usage
Palettes can be imported directly from the pylettes
package.
They can be transformed into matplotlib
color maps by instantiating the class and calling its cmap
attribute.
from pylettes import Acapulco2Paris
custom_cmap = Acapulco2Paris().cmap
Single colors can be directly accessed by index.
first_color = Acapulco2Paris()[0]
The show_colors
method allows you to visualize and inspect any palette.
Acapulco2Paris().show_colors()
The list of colors can be visualized as a continuous scale by providing the continuous
argument.
Acapulco2Paris().show_colors(continuous=True)
Palettes can be reversed by activating the reverse
flag upon initialization.
Acapulco2Paris(reverse=True).show_colors()
All currently available palettes can be inspected with list_all_palettes()
,
while list_palettes_by_tag()
allows you to search palettes by keywords.
All available tags can be listed with list_all_tag()
.
Finally, to visualize multiple palettes at once use show_multiple_palettes()
.
For example, you can inspect all colorblind-friendly palettes with
from pylettes import list_palettes_by_tag, show_multiple_palettes
show_multiple_palettes(list_palettes_by_tag('colorblind'))
Contributions
I plan to keep this library updated and add more options with time.
New palette submissions are welcome! Submitting a palette is easy, all you need is a name, the list of colors in hex format and associated tags.
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 pylettes-0.2.0.tar.gz
.
File metadata
- Download URL: pylettes-0.2.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.1 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc89497944a2515675ffd7aebc50eef42bfc5c536c6074361333749aa021646f |
|
MD5 | f845635e3f77d7fe02fb620da7626db1 |
|
BLAKE2b-256 | 848c51cf5a79eed5831f51a44f61fc0f96c1fdf7017d39377b0c638338b982c6 |
File details
Details for the file pylettes-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pylettes-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.1 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26113b5ec40b77985fcda14c8754c0a1ca8cb77deb4120a67759a57dd5614d88 |
|
MD5 | 32f1dd545050a75f371ea673ab0a0181 |
|
BLAKE2b-256 | c7a763d08b719b78fb8203e0b846f6743d4b0f964ea338e44867d2cc4d2505f8 |