Skip to main content

A simple package for generating spatially uniform preset colour maps and tools for calculating the CIEDE2000 to help generate custom maps

Project description

SicColours

This package was inspired by “The misuse of colour in science communication” (F. Crameri et al.) and was originally used as a tool to help me generate a scientifically appropriate colour map for representing data. The package consists of two separate scripts, “deltaE” which contains functions to calculate the CIEDE2000 colour difference between two rgb colours and “colour” which has some of my personal colour maps.

Currently, this package is a passion project and is still under development. I will be improving the existing colour gradients and adding new gradients overtime.

deltaE

“deltaE” contains a custom script that calculates the CIEDE2000 colour difference between two rgb colours. This package also includes a few functions to plot a discrete colour gradient (as a list of rgb tuples), alongside the CIEDE2000 error, cumulative error and brigtness.

Functions:

  • deltaE2000(LAB1,LAB2) // Calculates the deltaCIEDE2000 Error between two lab space colours in the form (L,a,b).
  • LMap(colourmapRGB,colour) // Plots the brightness of each colour in "colourmapRGB" (a discrete colour gradient as a list of rgb tuples), with a line colour of "colour" (integer in range of colourmapRGB)
  • ErrMap(colourmapRGB,colour) // Plots the CIEDE2000 Error between each pair of adjacent colour in "colourmapRGB" (a discrete colour gradient as a list of rgb tuples), with a line colour of "colour" (integer in range of colourmapRGB)
  • CumErrMap(colourmapRGB,colour) // Plots the cumulative CIEDE2000 Error between each pair of adjacent colour in "colourmapRGB" (a discrete colour gradient as a list of rgb tuples), with a line colour of "colour" (integer in range of colourmapRGB)
  • VisMap(colourmapRGB) // Plots a bar of each colour in "colourmapRGB" (a discrete colour gradient as a list of rgb tuples)
  • CMap(colourmap,c1 = 0, c2 = 1, c3 = 2) // Plots all of the plots listed above together using c1, c2 and c3 as line colours (integer in range of colourmapRGB)

Colour

This package will continue to be expanded, but contains a set of custom colour maps, each of which can be generated as a categorical map, continuous map or discrete map of specified steps. The colour maps were made to be:

  • aesthetically pleasing.
  • To have an approximately consistent colour difference between adjacent colours at all points in the colour map, so the map is uniform.
  • To be monotonically increasing in brightness, so that the map is still clear for colourblind viewers While they current maps may not be perfect I aim to improve these overtime

Functions:

Each colour map is defined as follows

  • example_map(categorical = False, continuous = False, steps = 60) // categorical (generates the colourmap such that each sucessive colour is distinct), continuous (generates a matplotlib LinearSegmentedColormap), steps (integer stating how many colours should be included in a discrete colour map)

Colour Maps:

  • greyscale (greyscale colour map from black to white)
  • rianbow (Non-scientific colour map from red to green to blue back to red (used for comparison))
  • blossom (colour map from dark purple through magenta to pale pink)
  • sunrise (colour map from dark blue through red to pale yellow)
  • mangrove (colour map from dark blue through cyan to pale lime)
  • fall (colour map from dark brown through red to pale yellow)
  • frostburn (colour map from dark purple through blue to pale blue)
  • verdantia (colour map from dark green through lime to pale yellow)

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

scicolours-0.1.4.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scicolours-0.1.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file scicolours-0.1.4.tar.gz.

File metadata

  • Download URL: scicolours-0.1.4.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for scicolours-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ba90ea1ba33be08877ecc8703553bc9bb1884073a773d223253f1cbc6ea6a1fa
MD5 a01dfe7905c211f2fa70fcb9db9084b2
BLAKE2b-256 4973707497ca312a47bb2c02610b6b258ba7a11f42523bbc0023b2a02ffb1d4e

See more details on using hashes here.

File details

Details for the file scicolours-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: scicolours-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for scicolours-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1deb2709b88ea71a028982ced15b0f9d1780166024ecc34bf09e88a15e928a7a
MD5 9dbe57c4a8b35c9fc6a0980dcec681b9
BLAKE2b-256 518c8d22051f10ea71e7ec7a4f45c13580b20e9d17ead521ef4ecfdc6d2caa25

See more details on using hashes here.

Supported by

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