Download Latest Version v1.7.0 source code.zip (523.6 kB)
Email in envelope

Get an email when there's a new version of Morphicons

Home / v1.6.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-08-08 1.2 kB
v1.6.0 source code.tar.gz 2026-08-08 391.1 kB
v1.6.0 source code.zip 2026-08-08 461.2 kB
Totals: 3 Items   853.5 kB 0

Added

  • 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.
Source: README.md, updated 2026-08-08