function getKey (color, prec=2) {
const hsl = d3.cubehelix(color)
let rc = '', h, s, l
if(prec < 0){
const k = -prec
const ck = k/2
const jk = k/3
const li = Math.round(+hsl.l * 256)
l = Math.round(Math.round(+hsl.l * 256) / jk) * jk / 256
s = Math.round(Math.round(+hsl.s * 256) / ck) * ck / 256
h = Math.round(Math.round(+hsl.h / k)) * k
}
else{
l = hsl.l.toFixed(prec)
s = hsl.s.toFixed(prec)
h = hsl.h.toFixed(prec)
}
return d3.color(d3.cubehelix(h,s,l)).hex()
}