Skip to content
/ avatar Public

Generates a random avatar for any given identifier. Always generates the same avatar for the same identifier.

License

Notifications You must be signed in to change notification settings

monooso/avatar

Repository files navigation

Avatar

Avatar generates a random avatar from a seed string. It is guaranteed to always generate the same avatar for the same seed, which makes it ideal for generating avatars based on usernames or ids.

An SVG generated by the Avatar module

Usage

import { generatePng, generateSvg } from "https://deno.land/x/avatar/mod.ts";

// Generate an SVG avatar with the default options.
let avatar = await generateSvg("jimbob");

// Generate an avatar with a custom size.
avatar = await generateSvg("marysue", { size: 128 });

// Generate an avatar with rounded corners...
avatar = await generateSvg("billybob", { radius: 10 });

// Or a full circle.
avatar = await generateSvg("libbymae", { radius: 100, size: 64 });

// Generate a PNG avatar.
avatar = await generatePng("cleetus", { radius: 20, size: 256 });

License

Avatar is open source software, released under the MIT license.

Credits

The avatars are generated using elements from the splendid Miniavs avatar builder, by Webpixels.

About

Generates a random avatar for any given identifier. Always generates the same avatar for the same identifier.

Resources

License

Stars

Watchers

Forks

Packages

No packages published