const _ = require("lodash")
const tinycolor = require("tinycolor2");
const color = 'blue';
const number = 10
const offset = Math.round(number / 2);
const monochromaticByLuminance = (color, steps) => {
const hsl = color.toHsl();
const { s, h } = hsl;
let { l } = hsl;
const modification = 1 / steps;
const ret = [];
_.times(steps, () => {
ret.push(tinycolor({ h, s, l }));
l = (l + modification) % 1;
});
return ret;
};
_(monochromaticByLuminance(tinycolor(color), number))
.sortBy(color => color.toHsl().l)
.reverse()
.map((color, index) => {
const hsl = color.toHsl();
const { s, l } = hsl;
let { h } = color.toHsl();
h = (h + 6 * index - (number / 2)) % 255;
//console.log({h, l, color: tinycolor({ h, s, l }).toHexString()});
return tinycolor({ h, s, l }).toHexString();
}).value();