| Crates.io | embedded-rgba |
| lib.rs | embedded-rgba |
| version | 0.1.1 |
| created_at | 2025-08-19 07:00:22.29235+00 |
| updated_at | 2025-08-21 06:57:33.770621+00 |
| description | RGBA support for embedded-graphics with fast framebuffers |
| homepage | https://github.com/dempfi/embedded-rgba |
| repository | https://github.com/dempfi/embedded-rgba |
| max_upload_size | |
| id | 1801472 |
| size | 158,775 |

A lightweight, no_std RGBA framebuffer and canvas abstraction for the embedded-graphics ecosystem. It adds alpha blending, buffering strategies, and a practical way to manage drawing pipelines on microcontrollers and resource‑constrained devices.
Check out the MiniType for a font format that takes full advantage of RGBA canvas.
Rgba pixels onto RGB framebuffers with fast per‑pixel transparency.embedded-graphics’s DrawTarget and PixelColor.use embedded_rgba::Canvas;
use embedded_graphics::mock_display::MockDisplay;
use embedded_graphics::pixelcolor::Rgb565;
let display = MockDisplay::new();
// Create a double buffered canvas
let mut canvas = Canvas::<_, _, {240 * 320}, 240, 320>::double_buffered(display);
// or a single buffer
let mut canvas = Canvas::<_, _, {240 * 320}, 240, 320>::single_buffered(display);
// `Rgba` is a normal embedded_graphics color
let transparent_orange = Rgba::new(Rgb565::CSS_ORANGE, 128);
let style = PrimitiveStyleBuilder::new().fill_color(transparent_orange).build();
// `canvas.alpha()` is a temporary draw target that can be drawn onto with `Rgba` color
Rectangle::new(Point::zero(), Size::new(50, 50)).draw_styled(&style, &mut canvas.alpha())?;
// Commit the update pixels to the display
canvas.flush().unwrap();