A collection of color palettes for mapping and visualisation
Project description
chrys
A collection of color palettes for mapping and visualisation.
Demo
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']
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
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
chrys-2.0.18.tar.gz
(32.8 kB
view details)
Built Distribution
chrys-2.0.18-py2-none-any.whl
(34.2 kB
view details)
File details
Details for the file chrys-2.0.18.tar.gz
.
File metadata
- Download URL: chrys-2.0.18.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff93597a1cca34034a725f291282961d2da5b01712b1b83ae76c0ab7e548e7ef |
|
MD5 | 70207673e41a7180689ea5b351fbc8c5 |
|
BLAKE2b-256 | 1d587e4ed2295a6ca0b74f4339b3c3d70f1c91dc4441d0fad2ecd830c53a219a |
File details
Details for the file chrys-2.0.18-py2-none-any.whl
.
File metadata
- Download URL: chrys-2.0.18-py2-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29e353558621ff7c5b135a58fa4ec29a779a003ac595bd2f9267b513c6342f84 |
|
MD5 | e974c9c8ac9093ea7dc7f1406b5f73da |
|
BLAKE2b-256 | 82624a41c632898071cfdb31ff035f34971e623edc41180231507eb2ab1716e4 |