Crates.io | initials |
lib.rs | initials |
version | 0.1.2 |
source | src |
created_at | 2018-10-20 10:19:45.612322 |
updated_at | 2018-10-20 21:56:40.463963 |
description | initials avatar for rust |
homepage | https://github.com/sonmezonur/initials.rs |
repository | https://github.com/sonmezonur/initials.rs.git |
max_upload_size | |
id | 91638 |
size | 11,824,642 |
initials
crate helps to generate customizable avatars with the initial characters from the names.
In your Cargo.toml, add the following:
[dependencies]
initials = "*"
Extern initials
crate and draw the image on your project:
extern crate initials;
use initials::{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
MIT