sprite colors
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user