#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

#527 in Images

Download history 203/week @ 2024-02-12 172/week @ 2024-02-19 33/week @ 2024-02-26 9/week @ 2024-03-04 10/week @ 2024-03-11 110/week @ 2024-03-25 2/week @ 2024-04-01

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

~515KB
~12K SLoC