C3

Consistent

Categorical

Colors

Deterministic colors for maps

Inspired by the Cantor set fractal

12345678
8
0.55
Saturation
0.8
Saturation end
0.5
Lightness
0.9
Lightness end
4.5
Midpoint
1
Steepness
0
Skewness
1
Weight strength
0
Offset
["#c63b3b", "#3dc8c8", "#87cb43", "#8b49cf", "#d3b051", "#5779d6", "#5dd97f", "#dc64bc"]

Install

Install from NPM

npm install @mapequation/c3

Source code is available on GitHub.

Features

  • Unlimited colors
    Generate as many colors you want
  • Any color scheme
    We generate color stops on the interval [0, 1]. Perfect to use with d3.
  • Deterministic
    You always get the same colors for the same requested number of colors.
  • Consistent
    If you increase the number of colors, it doesn't change the list of colors you already have.
  • Fast
    The complexity is O(n log(n)) for n colors.

Authors

Daniel Edler, Anton Eriksson