function genAvatar({size = 64} = {}) {
const c = document.createElement("canvas");
c.width = size;
c.height = size;
const ctx = c.getContext("2d");
const h1 = Math.floor(Math.random() * 360);
const hDelta = Math.random() * 40 + 20;
const h2 = h1 > 300 ? h1 - hDelta : h1 + hDelta;
const s = Math.floor(Math.random() * 40) + 40;
const l1 = Math.floor(Math.random() * 30) + 30;
const l2 = Math.floor(Math.random() * 30) + 50;
const r = size / 2;
const ang = Math.random() * Math.PI * 2;
const cx = (Math.cos(ang) + 1) * r;
const cy = (Math.sin(ang) + 1) * r;
const gradCenter = [cx, cy, size * 0.1];
const gradEdge = [cx, cy, size * 1.1];
const gradient = ctx.createRadialGradient(...gradCenter, ...gradEdge);
gradient.addColorStop(0, `hsl(${h1}, ${s}%, ${l1}%`);
gradient.addColorStop(1, `hsl(${h2}, ${s}%, ${l2}%`);
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, size, size);
return c;
}