Crate amaryllis

source ·
Expand description

A Rust library for generating fast, high-quality profile avatars.

Example

use amaryllis::Avatar;
 
// Simple
Avatar::new(200, 200, None, None).simple([255, 255, 255, 255])
    .save("simple_avatar.webp").unwrap();
 
// Simple with text
Avatar::new(
    200, 200,
    Option::Some("John Middlename Doe"),
    Option::Some([0, 0, 0, 255])
).simple([255, 255, 255, 255]).save(
    "simple_avatar_text.webp"
).unwrap();
 
// Gradient
Avatar::new(200, 200, None, None).gradient(0.0025, colorgrad::reds())
    .save("gradient_avatar.webp").unwrap();

// Gradient with text
Avatar::new(
    200, 200,
    Option::Some("John Middlename Doe"),
    Option::Some([0, 0, 0, 255])
).gradient(
    0.0025,
    CustomGradient::new().html_colors(&["deeppink", "cyan"]).build().unwrap()
)
.save("gradient_avatar_text.webp").unwrap();

Re-exports

Structs

  • Struct representing an avatar