theme: fix disabled button

This commit is contained in:
Ashley Wulber 2025-08-26 15:13:15 -04:00 committed by Jeremy Soller
parent 6f1fe2a28b
commit 94ee4e1915
2 changed files with 6 additions and 12 deletions

View file

@ -4,16 +4,10 @@ use palette::Srgba;
pub fn over<A: Into<Srgba>, B: Into<Srgba>>(a: A, b: B) -> Srgba {
let a = a.into();
let b = b.into();
let o_a = (alpha_over(a.alpha, b.alpha)).max(0.0).min(1.0);
let o_r = (c_over(a.red, b.red, a.alpha, b.alpha, o_a))
.max(0.0)
.min(1.0);
let o_g = (c_over(a.green, b.green, a.alpha, b.alpha, o_a))
.max(0.0)
.min(1.0);
let o_b = (c_over(a.blue, b.blue, a.alpha, b.alpha, o_a))
.max(0.0)
.min(1.0);
let o_a = (alpha_over(a.alpha, b.alpha)).clamp(0.0, 1.0);
let o_r = (c_over(a.red, b.red, a.alpha, b.alpha, o_a)).clamp(0.0, 1.0);
let o_g = (c_over(a.green, b.green, a.alpha, b.alpha, o_a)).clamp(0.0, 1.0);
let o_b = (c_over(a.blue, b.blue, a.alpha, b.alpha, o_a)).clamp(0.0, 1.0);
Srgba::new(o_r, o_g, o_b, o_a)
}

View file

@ -194,8 +194,8 @@ impl Component {
focus: accent,
divider: if is_high_contrast { on_50 } else { on_20 },
on: on_component,
disabled: over(base_50, base),
on_disabled: over(on_50, base),
disabled: base_50,
on_disabled: on_50,
border,
disabled_border,
}