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

Download https://raw.githubusercontent.com/bokeh/bokeh/0.12.4/bokehjs/src/coffee/api/palettes.ts to /src/data and run 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
>>> print to_discrete_palette(VEGA_PALETTES['viridis'], 6)
['#46327f', '#375c8d', '#27808e', '#1fa187', '#4ac26d', '#9fda3a']
>>> print 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 VEGA, continuous_palette, discrete_palette
>>> print discrete_palette(VEGA, 'viridis', 6)
['#46327f', '#375c8d', '#27808e', '#1fa187', '#4ac26d', '#9fda3a']
>>> print continuous_palette(VEGA, 'viridis', 6)
['#440356', '#414587', '#2a788e', '#22a884', '#79d152', '#fbe724']

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.13.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

chrys-2.0.13-py2-none-any.whl (20.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: chrys-2.0.13.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.12

File hashes

Hashes for chrys-2.0.13.tar.gz
Algorithm Hash digest
SHA256 e43d7b8d6945cebdc41475a5a25b20563ef573ad323ef08d7a5a3db6eda7b3ca
MD5 ac451cd5102a6701a9d82de25aa2cf14
BLAKE2b-256 a0a364a3f368b3b82a435cfda7f0886081b232700c444b9f68618a70aba440fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chrys-2.0.13-py2-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.12

File hashes

Hashes for chrys-2.0.13-py2-none-any.whl
Algorithm Hash digest
SHA256 f1e1a9cf64abe3b1662db5b750f9fe64fcf9b3db35f4693e912d0b80ee16bb35
MD5 7bd28d8e44259cc99cd11dfb547204f6
BLAKE2b-256 10fa30efb29ee1833cc61a6f1b8dd0ece66ac9da6df44f9f954880350579a489

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