sprite colors

This commit is contained in:
galister
2025-06-28 19:28:28 +09:00
parent d7c31d8699
commit 247c51c3b7
3 changed files with 19 additions and 3 deletions

View File

@@ -8,6 +8,8 @@ use crate::{
widget::sprite::{SpriteBox, SpriteBoxParams},
};
use super::{parse_color_hex, print_invalid_attrib};
pub fn parse_widget_sprite<'a>(
file: &'a ParserFile,
ctx: &mut ParserContext,
@@ -34,6 +36,13 @@ pub fn parse_widget_sprite<'a>(
glyph = CustomGlyphContent::from_file(&value).ok();
}
}
"color" => {
if let Some(color) = parse_color_hex(&value) {
params.color = Some(color);
} else {
print_invalid_attrib(&key, &value);
}
}
_ => {}
}
}