1 unstable release
0.1.0 | Jul 29, 2023 |
---|
#31 in #avatar
180KB
184 lines
amaryllis
A Rust library for generating fast, high-quality profile avatars.
Gradient avatars use colorgrad!
License
Licensed under the MIT License.
lib.rs
:
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();
Dependencies
~19MB
~316K SLoC