From 4a4b6e17be0bf82bff5a098e8c540854b451d2f7 Mon Sep 17 00:00:00 2001 From: Allan Zhang Date: Wed, 13 Mar 2024 03:10:27 -0400 Subject: [PATCH] fix(dynamic_color): secondary container color `secondary_container` is currently the same as `secondary`. This fixes it. The new test value is taken from the updated output. --- src/dynamic_color/material_dynamic_colors.rs | 2 +- tests/theme.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dynamic_color/material_dynamic_colors.rs b/src/dynamic_color/material_dynamic_colors.rs index 2f65eee..26c978e 100644 --- a/src/dynamic_color/material_dynamic_colors.rs +++ b/src/dynamic_color/material_dynamic_colors.rs @@ -331,7 +331,7 @@ impl MaterialDynamicColors { [tone, scheme] => if _is_monochrome(scheme) { if scheme.is_dark { 30.0 } else { 85.0 } } else if _is_fidelity(scheme) { if scheme.is_dark { 30.0 } else { 90.0 } } else { Self::_find_desired_chroma_by_tone(scheme.secondary_palette.hue(), scheme.secondary_palette.chroma(), if scheme.is_dark { 30.0 } else { 90.0 }, !scheme.is_dark) }; [background, scheme] => Self::highest_surface(scheme); [contrast_curve] => ContrastCurve { low: 1.0, normal: 1.0, medium: 3.0, high: 4.5 }; - [tone_delta_pair, _scheme] => ToneDeltaPair::new(Self::primary_container(), Self::primary(), 10.0, TonePolarity::Nearer, false); + [tone_delta_pair, _scheme] => ToneDeltaPair::new(Self::secondary_container(), Self::secondary(), 10.0, TonePolarity::Nearer, false); } define_key! { diff --git a/tests/theme.rs b/tests/theme.rs index 9a43c35..1193438 100644 --- a/tests/theme.rs +++ b/tests/theme.rs @@ -22,7 +22,7 @@ fn test_theme() -> Result<(), ParseError> { on_primary_fixed_variant: [255, 35, 80, 36], secondary: [255, 185, 204, 180], on_secondary: [255, 37, 52, 35], - secondary_container: [255, 185, 204, 180], + secondary_container: [255, 59, 75, 56], on_secondary_container: [255, 213, 232, 207], secondary_fixed: [255, 213, 232, 207], secondary_fixed_dim: [255, 185, 204, 180],