API referenceOptions
Options
The second argument to asciipaint() and asciipaintThree(), which takes all but dpr. Three of them change live through set(); the rest are fixed when the paint is created.
Add asciipaint to this project: a library that paints an image, video, canvas or three.js scene as coloured ASCII glyphs on WebGL2. 1. Settle the brief: what gets painted (the source), where it goes on the page, and the colour behind it. Ask me for whichever of the three my request leaves out. 2. Install asciipaint with this project's package manager. 3. Pick one entry point by source: - A still image or logo: import "asciipaint/element", then use <ascii-img src alt width height> in place of <img>. It takes its background from the page. In React with TypeScript, declare the element once, as the docs show. - A video, a canvas, or anything that moves: asciipaint(canvas, options) from "asciipaint", with autoRender(paint, () => paint.draw(source)) as the frame loop. - A three.js scene: asciipaintThree(renderer) from "asciipaint/three", with paint.render(scene, camera) where renderer.render was. Needs three 0.170 or newer. 4. Read https://asciipaint.prafficoding.workers.dev/llms-full.txt for the exact API of the entry point you picked. The library is new, so these docs are the only reliable source for its options and methods. 5. Wire it up so that each of these that applies holds: - It runs in client-side code (useEffect, onMount, an Astro island). - The canvas has a CSS width and height. - background is the colour behind the canvas, in every colour scheme the page has. - Geist Mono at weight 600 is loaded. With asciipaint() or asciipaintThree(), font may name a monospace font the page already has instead. - A source from another origin is served with CORS headers and loaded with crossOrigin = "anonymous". - Unmounting calls loop.stop() and paint.dispose(). - The plain source shows when WebGL2 is missing: asciipaint() sits in a try/catch, and <ascii-img> is registered only after a WebGL2 check. 6. Done when the project's type check and build pass, every applicable line of step 5 holds, and you've told me where to look to see it painted.
API referenceOptions
The second argument to asciipaint() and asciipaintThree(), which takes all but dpr. Three of them change live through set(); the rest are fixed when the paint is created.