diff options
| author | pml68 <contact@pml68.dev> | 2025-04-29 23:32:53 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-04-29 23:35:04 +0200 |
| commit | 0faeafa482e2b21d8021d3150e7341131a1db7bd (patch) | |
| tree | 5e8de88bb6fb890f6e2b285276679996fc729ecf /crates/material_theme/src | |
| parent | fix(material_theme): broken serde impl on `Theme` (diff) | |
| download | iced-builder-0faeafa482e2b21d8021d3150e7341131a1db7bd.tar.gz | |
fix(material_theme): missing `abs` when checking the alpha values in `mix`
Diffstat (limited to '')
| -rw-r--r-- | crates/material_theme/src/utils.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/material_theme/src/utils.rs b/crates/material_theme/src/utils.rs index 963c9fc..4c62ec3 100644 --- a/crates/material_theme/src/utils.rs +++ b/crates/material_theme/src/utils.rs @@ -116,7 +116,7 @@ pub fn mix(color1: Color, color2: Color, p2: f32) -> Color { let p1 = 1.0 - p2; if (color1.a - 1.0).abs() > COLOR_ERROR_MARGIN - || (color2.a - 1.0) > COLOR_ERROR_MARGIN + || (color2.a - 1.0).abs() > COLOR_ERROR_MARGIN { let a = color1.a * p1 + color2.a * p2; if a > 0.0 { |
