From 75ae0de9bdd3376b6e537bf59030059c926114ee Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 16 Nov 2022 17:42:41 +0100 Subject: feat: SVG styling with icon fill color --- style/src/svg.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 style/src/svg.rs (limited to 'style/src/svg.rs') diff --git a/style/src/svg.rs b/style/src/svg.rs new file mode 100644 index 00000000..66791d04 --- /dev/null +++ b/style/src/svg.rs @@ -0,0 +1,21 @@ +//! Change the appearance of a svg. + +use iced_core::Color; + +/// The appearance of a svg. +#[derive(Debug, Default, Clone, Copy)] +pub struct Appearance { + /// Changes the fill color + /// + /// Useful for coloring a symbolic icon. + pub fill: Option, +} + +/// The stylesheet of a svg. +pub trait StyleSheet { + /// The supported style of the [`StyleSheet`]. + type Style: Default + Copy; + + /// Produces the [`Appearance`] of the svg. + fn appearance(&self, style: Self::Style) -> Appearance; +} -- cgit