Deterministic dithered avatar generator in TypeScript inspired by Vercel avatars.
- Input: any string (for example a wallet address)
- Output: SVG string
- Style: fixed gradient base + seeded 2-color palette + ordered Bayer dithering
import { createDithr } from "dithr";
const svg = createDithr("0x742d35cc6634c0532925a3b844bc454e4438f44e", {
size: 24,
});Then render svg directly in the DOM or save it as an .svg file.
input: string(required, non-empty)options.size?: number(default:32)- returns:
string(SVG markup)
The playground is the root index.html.
npm run buildpython3 -m http.server 8080npm run build
npm run dev
npm run lint
npm run format- The package is ESM (
"type": "module"), so runtime import paths use.jsextensions internally. - If you change source, rebuild before testing playground or publishing pages:
npm run build