1
0
Fork 0
forked from wry/wry

theme: add ThemeColor enum

This commit is contained in:
Julian Orth 2026-03-07 11:55:25 +01:00
parent c75b6ef66e
commit cf8b696f03
4 changed files with 82 additions and 41 deletions

View file

@ -392,6 +392,25 @@ macro_rules! colors {
)*
}
#[derive(Copy, Clone, Debug, Linearize)]
#[expect(non_camel_case_types)]
pub enum ThemeColor {
$(
$name,
)*
}
impl ThemeColor {
pub fn field(self, theme: &Theme) -> &Cell<Color> {
let colors = &theme.colors;
match self {
$(
Self::$name => &colors.$name,
)*
}
}
}
impl ThemeColors {
pub fn reset(&self) {
let default = Self::default();