initials-revamped
is a fork from the initials
crate that allows generating customizable avatars with the initial characters from arbitrary name values.
-
Change lib path frominitials
toinitials-revamped
-
Submit crate to crates.io -
Use a more readable, fitting font (Roboto) -
Add support for directly using font bytes content (as opposed to paths) -
Update documention to include new features & change outdated info -
Better integration with the image crate -
Add awrite_to
method to write raw bytes data to an array
In your Cargo.toml, add the following:
[dependencies]
initials_revamped = "*"
use initials_crate::{AvatarBuilder, AvatarResult};
fn avatar() -> AvatarResult {
AvatarBuilder::new("Avatar")
.with_font_color("#000000")?
.with_background_color("#FAFAFA")?
.with_width(200)?
.with_height(200)
}
fn main() {
let avatar = avatar().unwrap();
let image = avatar.draw();
// use the generated image
}
See Documentation (original docs - still haven't written my own)
MIT
All the credit goes to Onur Sönmez, the original creator of this awesome lib.