项目作者: sonmezonur

项目描述 :
Initials avatar generator for Rust
高级语言: Rust
项目地址: git://github.com/sonmezonur/initials.rs.git
创建时间: 2018-07-17T14:41:18Z
项目社区:https://github.com/sonmezonur/initials.rs

开源协议:MIT License

下载


initials Build Status

initials crate helps to generate customizable avatars with the initial characters from the names.






Setup and Usage

In your Cargo.toml, add the following:

  1. [dependencies]
  2. initials = "*"

Extern initials crate and draw the image on your project:

  1. extern crate initials;
  2. use initials::{AvatarBuilder, AvatarResult};
  3. fn avatar() -> AvatarResult {
  4. AvatarBuilder::new("Avatar")
  5. .with_font_color("#000000")?
  6. .with_background_color("#FAFAFA")?
  7. .with_width(200)?
  8. .with_height(200)
  9. }
  10. fn main() {
  11. let avatar = avatar().unwrap();
  12. let image = avatar.draw();
  13. // use the generated image
  14. }

See Documentation

Example

App |
Doc

License

MIT