Skip to main content

Beautiful palettes in Python

Project description

Pylettes

v0.2.0

GitHub tag (latest by date) PyPI Licence GitHub top language Palettes count

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylettes-0.2.0.tar.gz (17.8 kB view hashes)

Uploaded Source

Built Distribution

pylettes-0.2.0-py3-none-any.whl (19.1 kB view hashes)

Uploaded Python 3

Supported by

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