Skip to content

revolunet/color-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

color-seed

npm package

Stable colors generator from given seed(s).

Based on seedrandom, chroma-js Spectral scale.

sample

Install

npm install color-seed

Usage

const color = require("color-seed");

const parisColor = color.getColor('paris');
// always return #a70b44

demo : https://codesandbox.io/s/jzqn0m1z03

Tests

  colorSeed
    colorSeed.getColor : single seed
      ✓ getColor("Paris") should return #a70b44
      ✓ getColor("Marseille") should return #7acaa5
      ✓ getColor("Bordeaux") should return #9ed8a4
    colorSeed.getColors : multiple seed
      ✓ getColors(["Paris", "Marseille", "Bordeaux"]) should return #a70b44, #7acaa5, #9ed8a4
      ✓ getColors(["Paris", "Marseille", "Bordeaux", "xxx"]) should return #a70b44, #7acaa5, #9ed8a4, #3683bb

  5 passing (13ms)