Public
Edited
Sep 20, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getColorData(d, type, value) {
console.log(d);
console.log(type);
console.log(value);
console.log("result");
console.log(getHSL(d, type)[value]);
if (value === "hue" || value === "saturation" || value === "lightness") {
return getHSL(d, type)[value];
} else {
let rgb = d[type]["rgb"];
if (rgb == null) {
rgb = [d[type].r, d[type].g, d[type].b];
}
return rgb[value];
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more