{
let canvas
if (typeof HTMLCanvasElement.prototype.transferControlToOffscreen !== "undefined") {
canvas = new window.OffscreenCanvas(...size);
} else {
canvas = document.createElement("canvas");
canvas.width = canvas.height = size;
}
const ctx = canvas.getContext("2d");
return ctx.canvas
}