You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
canvasTarget(canvas | ctx, opts?) — 2D canvas out. The morph draws straight into a canvas: every d write becomes one stroke(new Path2D(d)), so the icon stops being a document node and becomes pixels you own — a live WebGL texture (texImage2D(..., canvas)), a toBlob() sprite, a captureStream() video track, an animated favicon, an OffscreenCanvas in a worker. Accepts an HTMLCanvasElement, an OffscreenCanvas or a bare 2D context (structural, like every core contract; throws early without a 2D context or Path2D). Geometry maps per write onto whatever backing store it finds — min-side scale, centered (the canvas xMidYMid meet), so non-square canvases letterbox and devicePixelRatio stays the owner's business. Color cascades: color option > the canvas' computed CSS color (the moral equivalent of currentColor, read lazily once) > the context's current strokeStyle where CSS can't reach. clear: false for manual compositing and trails; onWrite fires after every drawn frame as the texture consumer's dirty signal — hosts with their own render loop composite a small dedicated canvas instead of handing over their context. 0.48 KB gzip standalone, the lightest adapter yet.