From 0faeafa482e2b21d8021d3150e7341131a1db7bd Mon Sep 17 00:00:00 2001 From: pml68 Date: Tue, 29 Apr 2025 23:32:53 +0200 Subject: fix(material_theme): missing `abs` when checking the alpha values in `mix` --- crates/material_theme/src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/material_theme') 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 { -- cgit v1.2.3