Skip to main content

A collection of color palettes for mapping and visualisation

Project description

chrys

A collection of color palettes for mapping and visualisation.

Demo

netbek.github.io/chrys

Sass

Installation

npm install chrys

Usage

See the demo for a list of palette names and sizes.

@import 'node_modules/chrys/src/variables';

// Get the first color of the `colorblind` palette, size 3
$palette-name: 'colorblind';
$palette-size: 3;
$palette:      map-get(map-get($chrys-color-map, $palette-name), $palette-size);
$color:        nth($palette, 1);

div {
  background: $color;
}

Development

Build distribution files:

gulp

Python

Installation

pip install chrys

Usage

Generate a new palette as a subset of a given palette:

>>> from chrys.palettes import VEGA_PALETTES, to_continuous_palette, to_discrete_palette
>>> to_discrete_palette(VEGA_PALETTES['viridis'], 6)
['#46327f', '#375c8d', '#27808e', '#1fa187', '#4ac26d', '#9fda3a']
>>> to_continuous_palette(VEGA_PALETTES['viridis'][256], 6)
['#440356', '#414587', '#2a788e', '#22a884', '#79d152', '#fbe724']

Generate a new palette as a subset of a palette from a given provider:

>>> from chrys.palettes import continuous_palette, discrete_palette
>>> discrete_palette('vega_viridis', 6)
['#46327f', '#375c8d', '#27808e', '#1fa187', '#4ac26d', '#9fda3a']
>>> continuous_palette('vega_viridis', 6)
['#440356', '#414587', '#2a788e', '#22a884', '#79d152', '#fbe724']

Get the vendor library and palette names from a given name:

>>> from chrys.palettes import parse_palette_name
>>> parse_palette_name('vega_viridis')
('vega', 'viridis')

Development

Install Node and Python dependencies:

./scripts/install.sh

Build palette data:

npm run py-build-data

Build distribution package:

npm run py-build-dist

Publish distribution package:

npm run py-publish

Credit

Palettes from:

License

Copyright (c) 2017 Hein Bekker. Licensed under the BSD 3-Clause License.

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

chrys-2.0.25.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

chrys-2.0.25-py2-none-any.whl (41.7 kB view details)

Uploaded Python 2

File details

Details for the file chrys-2.0.25.tar.gz.

File metadata

  • Download URL: chrys-2.0.25.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/2.7.15+

File hashes

Hashes for chrys-2.0.25.tar.gz
Algorithm Hash digest
SHA256 fa2de452a2816adc8f57d07fbae70614236c1adcc81235b5c55658edc9208d3f
MD5 0a1611ba91ae2401df319d5db4ec842c
BLAKE2b-256 3acc0f52df3bdff7ed276c9bc0b84d3cfcf8f8df0b600f777b2ec48feeef5786

See more details on using hashes here.

File details

Details for the file chrys-2.0.25-py2-none-any.whl.

File metadata

  • Download URL: chrys-2.0.25-py2-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/2.7.15+

File hashes

Hashes for chrys-2.0.25-py2-none-any.whl
Algorithm Hash digest
SHA256 6fc42705eed1ee83a470e4a4c11b06909f4cc910ac8809c55aec023eb87af348
MD5 dc7944a723f78767bab57ef13dba6f9a
BLAKE2b-256 874a469b6a65ebda3bb1774bc61d0c56896664c29ee2737f00527e3b3c08a8db

See more details on using hashes here.

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