function* genColorValue(
start,
hcent = 0.2,
scent = 0.2,
lcent = 0.2,
frequency = 1,
cubehelix = false
) {
const rgbColor = d3.color(start);
const hslColor = cubehelix ? d3.cubehelix(rgbColor) : d3.hsl(rgbColor);
const hgen = genValue(hslColor.h, 0, 360, hcent, frequency);
const sgen = genValue(hslColor.s, 0, 1.0, scent, frequency);
const lgen = genValue(hslColor.l, 0, 1.0, lcent, frequency);
while (true) {
const nextH = hgen.next();
const nextS = sgen.next();
const nextL = lgen.next();
const nextColor = d3.color(
cubehelix
? d3.cubehelix(nextH.value, nextS.value, nextL.value)
: d3.hsl(nextH.value, nextS.value, nextL.value)
);
yield nextColor;
}
}