1.1.1 • Published 2 years ago

@mapequation/c3 v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

C3 - Consistent Categorical Colors

A library to generate distinct categorical colors, written in TypeScript.

Documentation

Install

npm install @mapequation/c3

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.

The algorithm is inspired by the Cantor set, which is a fractal that subdivides an interval recursively into smaller subsets.

Authors

Daniel Edler, Anton Eriksson

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

3 years ago