Move Canvas and QRCode to iced crate
Rename `canvas` modules to `geometry` in graphics subcrates
This commit is contained in:
parent
d13d19ba35
commit
6cc48b5c62
39 changed files with 140 additions and 148 deletions
23
graphics/src/geometry/style.rs
Normal file
23
graphics/src/geometry/style.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use crate::{Color, Gradient};
|
||||
|
||||
/// The coloring style of some drawing.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Style {
|
||||
/// A solid [`Color`].
|
||||
Solid(Color),
|
||||
|
||||
/// A [`Gradient`] color.
|
||||
Gradient(Gradient),
|
||||
}
|
||||
|
||||
impl From<Color> for Style {
|
||||
fn from(color: Color) -> Self {
|
||||
Self::Solid(color)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Gradient> for Style {
|
||||
fn from(gradient: Gradient) -> Self {
|
||||
Self::Gradient(gradient)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue