From ff7e17988d5868c72cfb39d09ccf4efb05d3ceda Mon Sep 17 00:00:00 2001 From: Polesznyák Márk Date: Sat, 22 Nov 2025 08:30:00 +0100 Subject: feat!: combine `Primary`, `Secondary`, `Tertiary` and `Error` Now only a singular `ColorQuartet` struct exists. Also rename some `Surface` and `Inverse` fields for consistency. --- src/button.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/button.rs') diff --git a/src/button.rs b/src/button.rs index 7a35e10..3b2d871 100644 --- a/src/button.rs +++ b/src/button.rs @@ -70,8 +70,8 @@ pub fn elevated(theme: &Theme, status: Status) -> Style { let surface = theme.colors().surface; let foreground = theme.colors().primary.color; - let background = surface.surface_container.low; - let disabled = surface.on_surface; + let background = surface.container.low; + let disabled = surface.text; let shadow_color = theme.colors().shadow; @@ -81,9 +81,9 @@ pub fn elevated(theme: &Theme, status: Status) -> Style { pub fn filled(theme: &Theme, status: Status) -> Style { let primary = theme.colors().primary; - let foreground = primary.on_primary; + let foreground = primary.text; let background = primary.color; - let disabled = theme.colors().surface.on_surface; + let disabled = theme.colors().surface.text; let shadow_color = theme.colors().shadow; @@ -93,9 +93,9 @@ pub fn filled(theme: &Theme, status: Status) -> Style { pub fn filled_tonal(theme: &Theme, status: Status) -> Style { let secondary = theme.colors().secondary; - let foreground = secondary.on_secondary_container; - let background = secondary.secondary_container; - let disabled = theme.colors().surface.on_surface; + let foreground = secondary.container_text; + let background = secondary.container; + let disabled = theme.colors().surface.text; let shadow_color = theme.colors().shadow; styled(background, foreground, disabled, shadow_color, 0, status) @@ -104,7 +104,7 @@ pub fn filled_tonal(theme: &Theme, status: Status) -> Style { pub fn outlined(theme: &Theme, status: Status) -> Style { let foreground = theme.colors().primary.color; let background = Color::TRANSPARENT; - let disabled = theme.colors().surface.on_surface; + let disabled = theme.colors().surface.text; let outline = theme.colors().outline.color; @@ -136,7 +136,7 @@ pub fn outlined(theme: &Theme, status: Status) -> Style { pub fn text(theme: &Theme, status: Status) -> Style { let foreground = theme.colors().primary.color; let background = Color::TRANSPARENT; - let disabled = theme.colors().surface.on_surface; + let disabled = theme.colors().surface.text; let style = styled( background, -- cgit v1.2.3