summaryrefslogtreecommitdiffstats
path: root/style/src/svg.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-12-06 05:15:16 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-06 05:15:16 +0100
commitf38e7fcac2e3505d11577ade1757a77ca2a544ea (patch)
tree84b3dc6c88aa555cf931482adcf4e7be35614b72 /style/src/svg.rs
parent28f0beee52f258af6bbaf8a0d9867863d7513c9b (diff)
parentf99d24e0850b63194b7976ec66d547ea2ff6bfc8 (diff)
downloadiced-f38e7fcac2e3505d11577ade1757a77ca2a544ea.tar.gz
iced-f38e7fcac2e3505d11577ade1757a77ca2a544ea.tar.bz2
iced-f38e7fcac2e3505d11577ade1757a77ca2a544ea.zip
Merge pull request #1578 from iced-rs/svg-styling
Svg styling
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;
+}