diff --git a/cosmic-theme/src/model/theme.rs b/cosmic-theme/src/model/theme.rs index ce314c80..8883def4 100644 --- a/cosmic-theme/src/model/theme.rs +++ b/cosmic-theme/src/model/theme.rs @@ -92,6 +92,8 @@ pub struct Theme { pub window_hint: Option, /// enables blurred transparency pub is_frosted: bool, + /// shade color for dialogs + pub shade: Srgba, } impl Default for Theme { @@ -372,6 +374,11 @@ impl Theme { self.corner_radii.radius_xl } + /// get @shade_color + pub fn shade_color(&self) -> Srgba { + self.shade + } + /// get the active theme pub fn get_active() -> Result, Self)> { let config = @@ -738,6 +745,11 @@ impl ThemeBuilder { let mut theme: Theme = Theme { name: palette.name().to_string(), + shade: if palette.is_dark() { + Srgba::new(0., 0., 0., 0.32) + } else { + Srgba::new(0., 0., 0., 0.08) + }, primary: Container::new( primary_component, primary_container_bg,