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

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

#550 in Images

Download history 110/week @ 2024-06-10 14/week @ 2024-07-29

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
~12K SLoC