canvas = {
const r = 2.5;
const context = DOM.context2d(width, height);
const curve = d3.curveBasisClosed(context);
context.lineWidth = 1.5;
while (true) {
const points = [...circles(Date.now())];
const voronoi = d3.Delaunay.from(points).voronoi([0, 0, width, height]);
context.fillStyle = "#00a";
context.fillRect(0, 0, width, height);
context.fillStyle = "#0a0";
for (let i = 49, n = points.length; i < n; ++i) {
context.beginPath();
context.fillStyle = ("#0" + Math.round(((i + Date.now()/100) / 5) % 9) + "" + Math.round(9 - ((i + Date.now()/100) / 5) % 9));
const cell = voronoi.cellPolygon(i);
if (cell === null) continue;
resample(curve, cell);
context.fill();
context.stroke();
context.closePath();
}
yield context.canvas;
}
}