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

Reason this release was yanked:

Bugged

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.2.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.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scicolours-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 da4d04ec62b915c6b355a60e3577c64cdf652546cdcdc9a851b57e24fa7f7a7b
MD5 5556b5b7c9ec24fe599bd0e44ed3cb22
BLAKE2b-256 eeaf77544b7c5f43ee274103c89906bb06d2f52e8b19d43bec21165942f058da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scicolours-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b39064702ecc94bee53d39dfc9a1ff910ba1302b3618fe603cae7e2d9a9b770
MD5 c0d093b2ac0211c323a0659baafc100b
BLAKE2b-256 15ac549be60a78da86512d30398f7593fb299a321c208423b33ceaef41469a3e

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