web2d-kit
v0.1.0
Published
Small Canvas 2D primitives for web graphics.
Readme
Web2D Kit
Small, dependency-free Canvas 2D primitives for web graphics.
Web2D Kit is the Canvas 2D sibling of Web3D Kit. It provides small, direct helpers for browser canvas work.
Install
npm install web2d-kitUsage
Use getCanvas2DContext when code needs a usable Canvas 2D context rather
than a nullable result.
import { getCanvas2DContext } from "web2d-kit";
const context = getCanvas2DContext(canvas);
context.clearRect(0, 0, canvas.width, canvas.height);Included
- one checked Canvas 2D context lookup for
HTMLCanvasElementandOffscreenCanvas
Intentionally excluded
No scene model, render graph, drawing DSL, framework binding, or dependency lives here. Web3D Kit remains the portable scene model for 3D work. Add an API only when a second consumer cannot use the platform directly.
