#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

#513 in Images

Download history 203/week @ 2024-02-13 175/week @ 2024-02-20 34/week @ 2024-02-27 6/week @ 2024-03-05 9/week @ 2024-03-12 4/week @ 2024-03-19 106/week @ 2024-03-26 2/week @ 2024-04-02

112 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

~515KB
~12K SLoC