function ramp(interpolate) {
const color = d3.scaleSequential(interpolate),
res = getProfile(color);
const height = 200,
context = DOM.context2d(width, height),
x = d3.scaleLinear([0, res.colors.length - 1], [0, width]),
diff = blur().radius(4)(res.diff),
y = d3.scaleLinear([0, 1], [height, 1]),
line = d3
.line()
.x((_, i) => x(i + .5))
.y(y)
.context(context),
data = [];
for (let i = 0; i < res.colors.length; i++) {
context.fillStyle = res.colors[i];
context.fillRect(x(i), 0, x(i + 1) + 1 - x(i), height);
}
context.strokeStyle = "white";
context.beginPath();
line(diff);
context.stroke();
return context.canvas;
}