iced-yoda/style/src/svg.rs

24 lines
568 B
Rust
Raw Normal View History

2022-11-16 17:42:41 +01:00
//! Change the appearance of a svg.
use iced_core::Color;
/// The appearance of an SVG.
2022-11-16 17:42:41 +01:00
#[derive(Debug, Default, Clone, Copy)]
pub struct Appearance {
/// The [`Color`] filter of an SVG.
2022-11-16 17:42:41 +01:00
///
/// Useful for coloring a symbolic icon.
///
/// `None` keeps the original color.
pub color: Option<Color>,
2022-11-16 17:42:41 +01:00
}
/// The stylesheet of a svg.
pub trait StyleSheet {
/// The supported style of the [`StyleSheet`].
type Style: Default;
2022-11-16 17:42:41 +01:00
/// Produces the [`Appearance`] of the svg.
fn appearance(&self, style: &Self::Style) -> Appearance;
2022-11-16 17:42:41 +01:00
}