Plot.plot({
width,
height: 800,
axis: null,
marks: [
Plot.dot(
d3.cross(d3.ticks(0, 1.2, 200), d3.ticks(0, 1, 200)).map(([x, y]) => {
const c = d3.rgb(d3.hcl(x * 360, 140, y * 120));
return {
x,
y,
R: c.r,
G: c.g,
B: c.b,
c: `color(display-p3 ${(c.r / 256).toFixed(2)} ${(c.g / 256).toFixed(
2
)} ${(c.b / 256).toFixed(2)})`
};
}),
{
x: "x",
y: "y",
fill: "c",
channels: { R: "R", G: "G", B: "B" },
tip: true,
r: 4
}
)
]
})