diff options
author | 2023-05-19 03:32:21 +0200 | |
---|---|---|
committer | 2023-05-19 03:32:21 +0200 | |
commit | 4c1a082f0468a59099bbf8aa8991420a41234948 (patch) | |
tree | 42308071bc180f364c71cdc0bb0011235c01fe14 /core/src/background.rs | |
parent | 6551a0b2ab6c831dd1d3646ecf55180339275e22 (diff) | |
download | iced-4c1a082f0468a59099bbf8aa8991420a41234948.tar.gz iced-4c1a082f0468a59099bbf8aa8991420a41234948.tar.bz2 iced-4c1a082f0468a59099bbf8aa8991420a41234948.zip |
Remove `Builder` abstractions for gradients
Diffstat (limited to 'core/src/background.rs')
-rw-r--r-- | core/src/background.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/core/src/background.rs b/core/src/background.rs index 6af33c3e..347c52c0 100644 --- a/core/src/background.rs +++ b/core/src/background.rs @@ -1,4 +1,5 @@ -use crate::{Color, Gradient}; +use crate::gradient::{self, Gradient}; +use crate::Color; /// The background of some element. #[derive(Debug, Clone, Copy, PartialEq)] @@ -16,14 +17,14 @@ impl From<Color> for Background { } } -impl From<Color> for Option<Background> { - fn from(color: Color) -> Self { - Some(Background::from(color)) +impl From<Gradient> for Background { + fn from(gradient: Gradient) -> Self { + Background::Gradient(gradient) } } -impl From<Gradient> for Option<Background> { - fn from(gradient: Gradient) -> Self { - Some(Background::Gradient(gradient)) +impl From<gradient::Linear> for Background { + fn from(gradient: gradient::Linear) -> Self { + Background::Gradient(Gradient::Linear(gradient)) } } |