| Crates.io | clove2d |
| lib.rs | clove2d |
| version | 0.1.1 |
| created_at | 2025-12-03 22:39:26.023518+00 |
| updated_at | 2025-12-03 22:39:26.023518+00 |
| description | A powerful 2D graphics library for Rust with support for shapes, text, images, filters, and layers |
| homepage | |
| repository | https://github.com/1he03/Clove2d |
| max_upload_size | |
| id | 1965437 |
| size | 6,618,381 |
A powerful 2D graphics library for Rust with support for shapes, text, images, filters, and layers.
Add this to your Cargo.toml:
[dependencies]
clove2d = "0.1.1"
use clove2d::prelude::*;
fn main() -> Result<()> {
let mut canvas = Canvas::builder()
.size(800, 600)
.background(Color::hex("#1A1A1A")?)
.build()?;
canvas.create_layer("shapes")?
.draw_rect()
.position(100.0, 100.0)
.size(200.0, 150.0)
.fill(Color::hex("#FF6B6B")?)
.stroke(Color::named(NamedColor::White), 2.0)
.draw()?
.draw_circle()
.center(400.0, 200.0)
.radius(75.0)
.fill(Color::linear_gradient()
.start(400.0, 125.0)
.end(400.0, 275.0)
.add_stop(0.0, Color::hex("#667EEA")?)
.add_stop(1.0, Color::hex("#764BA2")?)
.build())
.draw()?;
canvas.save("output.png")?;
Ok(())
}
Licensed under either of
at your option.