-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2229 from clarkmoody/custom-qr-style
QR Code Styling
- Loading branch information
Showing
6 changed files
with
191 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.