summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-03 05:09:07 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-11-03 05:09:07 +0100
commit921c94162e50b09604fafeeb319c4a424d64be0e (patch)
treeeff2e63d6cbef2732bd9f29c5733181191ef0a12 /style
parent93e309f491a8941bafb919e75d660e65071475f4 (diff)
parent231d2fd8454eb9d24ba970131d4d7339cc0c8d51 (diff)
downloadiced-921c94162e50b09604fafeeb319c4a424d64be0e.tar.gz
iced-921c94162e50b09604fafeeb319c4a424d64be0e.tar.bz2
iced-921c94162e50b09604fafeeb319c4a424d64be0e.zip
Merge branch 'master' into fear/linear-gradients
Diffstat (limited to 'style')
-rw-r--r--style/Cargo.toml4
-rw-r--r--style/src/theme/palette.rs11
2 files changed, 7 insertions, 8 deletions
diff --git a/style/Cargo.toml b/style/Cargo.toml
index cf9d328b..4a482a4f 100644
--- a/style/Cargo.toml
+++ b/style/Cargo.toml
@@ -18,5 +18,5 @@ features = ["palette"]
[dependencies.palette]
version = "0.6"
-[dependencies.lazy_static]
-version = "1.4"
+[dependencies.once_cell]
+version = "1.15"
diff --git a/style/src/theme/palette.rs b/style/src/theme/palette.rs
index 81aa9cc7..4fb5e4c8 100644
--- a/style/src/theme/palette.rs
+++ b/style/src/theme/palette.rs
@@ -1,6 +1,6 @@
use iced_core::Color;
-use lazy_static::lazy_static;
+use once_cell::sync::Lazy;
use palette::{FromColor, Hsl, Mix, RelativeContrast, Srgb};
#[derive(Debug, Clone, Copy, PartialEq)]
@@ -66,11 +66,10 @@ pub struct Extended {
pub danger: Danger,
}
-lazy_static! {
- pub static ref EXTENDED_LIGHT: Extended =
- Extended::generate(Palette::LIGHT);
- pub static ref EXTENDED_DARK: Extended = Extended::generate(Palette::DARK);
-}
+pub static EXTENDED_LIGHT: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::LIGHT));
+pub static EXTENDED_DARK: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::DARK));
impl Extended {
pub fn generate(palette: Palette) -> Self {