color-seed
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "color-seed", | ||
"description": "Predictable colors generator from a seed", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "Julien Bouquillon <julien@revolunet.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -7,3 +7,3 @@ # color-seed | ||
Based on [seedrandom](https://github.com/davidbau/seedrandom) and [chroma-js](http://gka.github.io/chroma.js) Spectral scale. | ||
Based on [seedrandom](https://github.com/davidbau/seedrandom), [chroma-js](http://gka.github.io/chroma.js) Spectral scale. | ||
@@ -10,0 +10,0 @@ ![sample](./sample.png) |
@@ -5,3 +5,3 @@ var seedrandom = require('seedrandom'); | ||
const getPredictibleRandom = seed => { | ||
function getPredictibleRandom(seed) { | ||
Math.seedrandom(seed); | ||
@@ -13,5 +13,9 @@ return Math.random(); | ||
const getColor = (seed) => DEFAULT_SCALE(getPredictibleRandom(seed)).hex() | ||
function getColor(seed){ | ||
return DEFAULT_SCALE(getPredictibleRandom(seed)).hex() | ||
} | ||
const getColors = seeds => seeds.map(r => getColor(r)); | ||
function getColors(seeds) { | ||
return seeds.map(r => getColor(r)); | ||
} | ||
@@ -18,0 +22,0 @@ |
68
23321
7