#svg #avatar #graphics #2d #generate #library

svg_avatars

A Rust library for generating SVG avatars from identifiers

4 releases

0.1.3 Feb 21, 2024
0.1.2 Feb 21, 2024
0.1.1 Feb 14, 2024
0.1.0 Feb 14, 2024

#722 in Images

Download history 14/week @ 2024-07-27 1/week @ 2024-09-21 4/week @ 2024-09-28

98 downloads per month

MIT license

19KB
299 lines

SVG avatars

master Crates.io docs.rs Crates.io

A Rust library for generating SVG avatars from identifiers.

Example

use svg_avatars::{Rings, SvgAvatarBuilder};

fn main() {
    let svg = SvgAvatarBuilder::new()
        .identifier("foo")
        .rings(Rings::Three)
        .stroke_color("black")
        .build();

    svg.save("bar.svg").unwrap();
}

This produces the bar.svg file with the following content:

three rings example

License

MIT; see the LICENSE.txt file.

Dependencies

~530KB
~13K SLoC