summaryrefslogtreecommitdiffstats
path: root/style/src/qr_code.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-10 00:12:54 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-10 00:12:54 +0100
commit7ee00e751a8fe5cedadeeb478c6f0e7d6a5dc0dc (patch)
treeb8929e4c9c61af800f1dba8664f19a15c0dc13a2 /style/src/qr_code.rs
parent99a3f25c5f95a144fee7d25b4607f7275abcfaa2 (diff)
parent564ad95806efd1259a2244a685b648346b460abf (diff)
downloadiced-7ee00e751a8fe5cedadeeb478c6f0e7d6a5dc0dc.tar.gz
iced-7ee00e751a8fe5cedadeeb478c6f0e7d6a5dc0dc.tar.bz2
iced-7ee00e751a8fe5cedadeeb478c6f0e7d6a5dc0dc.zip
Merge pull request #2229 from clarkmoody/custom-qr-style
QR Code Styling
Diffstat (limited to 'style/src/qr_code.rs')
-rw-r--r--style/src/qr_code.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/style/src/qr_code.rs b/style/src/qr_code.rs
new file mode 100644
index 00000000..02c4709a
--- /dev/null
+++ b/style/src/qr_code.rs
@@ -0,0 +1,20 @@
+//! Change the appearance of a QR code.
+use crate::core::Color;
+
+/// The appearance of a QR code.
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub struct Appearance {
+ /// The color of the QR code data cells
+ pub cell: Color,
+ /// The color of the QR code background
+ pub background: Color,
+}
+
+/// A set of rules that dictate the style of a QR code.
+pub trait StyleSheet {
+ /// The supported style of the [`StyleSheet`].
+ type Style: Default;
+
+ /// Produces the style of a QR code.
+ fn appearance(&self, style: &Self::Style) -> Appearance;
+}