summaryrefslogtreecommitdiffstats
path: root/style/src/svg.rs
diff options
context:
space:
mode:
authorLibravatar Casper Storm <casper.storm@lich.io>2022-12-13 09:31:57 +0100
committerLibravatar Casper Storm <casper.storm@lich.io>2022-12-13 09:31:57 +0100
commit2e6d90f141217bad83eacd392562c13d7485881f (patch)
treebaa2c507076073aed4fd24abc9c7a7949d85c039 /style/src/svg.rs
parentba95042fff378213f5029b2b164d79e768482a47 (diff)
parent02182eea45537c9eb5b2bddfdff822bb8a3d143d (diff)
downloadiced-2e6d90f141217bad83eacd392562c13d7485881f.tar.gz
iced-2e6d90f141217bad83eacd392562c13d7485881f.tar.bz2
iced-2e6d90f141217bad83eacd392562c13d7485881f.zip
Merge branch 'master' into feat/slider-orientation
Diffstat (limited to 'style/src/svg.rs')
-rw-r--r--style/src/svg.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/style/src/svg.rs b/style/src/svg.rs
new file mode 100644
index 00000000..9378c1a7
--- /dev/null
+++ b/style/src/svg.rs
@@ -0,0 +1,23 @@
+//! Change the appearance of a svg.
+
+use iced_core::Color;
+
+/// The appearance of an SVG.
+#[derive(Debug, Default, Clone, Copy)]
+pub struct Appearance {
+ /// The [`Color`] filter of an SVG.
+ ///
+ /// Useful for coloring a symbolic icon.
+ ///
+ /// `None` keeps the original color.
+ pub color: Option<Color>,
+}
+
+/// The stylesheet of a svg.
+pub trait StyleSheet {
+ /// The supported style of the [`StyleSheet`].
+ type Style: Default;
+
+ /// Produces the [`Appearance`] of the svg.
+ fn appearance(&self, style: &Self::Style) -> Appearance;
+}