Crates.io | material-egui |
lib.rs | material-egui |
version | 0.1.7 |
source | src |
created_at | 2024-03-23 12:07:59.643629 |
updated_at | 2024-04-08 12:39:55.828765 |
description | Material Design color theme generator for Egui |
homepage | |
repository | |
max_upload_size | |
id | 1183501 |
size | 150,484 |
M3-EGUI
M3-EGUI (material-egui) is a library that takes an input color and generates a color palette using M3 colors. It then applies those colors to the Egui components.
cargo install material-egui
material-egui = "*"
This can be done anywhere that CTX is available. The same can be done with Ui but this is not recommended
// input color, is_dark_theme, zoom scale
MaterialColors::new(String::from("F0F"), true, 1.5).apply(&ctx);
// if you'd like the ability to scale windows AND a better default scale, use this
MaterialColors::new(String::from("F0F"), true, 1.5).apply(&ctx, &mut self.zoom);
Yes it will, as long as you have the following minimum versions
egui = "0.26.2"
eframe = "0.26.2"
I have not tested every element combination and there is probably a few edge cases, make sure to create an issue for them to be resolved
You will need a scope and the error style changer, this is a temporary solution until I find a better one
// this scope applies error colors to all elements inside
ui.scope(|ui| {
MaterialColors::new(String::from("F0F"), true, 1.5).error_apply(ui);
ui.button("Error button!")
});
// alternatively, if you already have your colors defined
ui.scope(|ui| {
self.colors.error_apply(ui);
ui.button("Error button!")
});
Special thanks to the Egui team, and the people who made material-colors
who made this project possible.