From 6551a0b2ab6c831dd1d3646ecf55180339275e22 Mon Sep 17 00:00:00 2001 From: Bingus Date: Thu, 11 May 2023 09:12:06 -0700 Subject: Added support for gradients as background variants + other optimizations. --- style/src/button.rs | 3 +++ style/src/theme.rs | 3 +++ 2 files changed, 6 insertions(+) (limited to 'style/src') diff --git a/style/src/button.rs b/style/src/button.rs index a564a2b7..32ec28b7 100644 --- a/style/src/button.rs +++ b/style/src/button.rs @@ -68,6 +68,9 @@ pub trait StyleSheet { a: color.a * 0.5, ..color }), + Background::Gradient(gradient) => { + Background::Gradient(gradient.mul_alpha(0.5)) + } }), text_color: Color { a: active.text_color.a * 0.5, diff --git a/style/src/theme.rs b/style/src/theme.rs index d9893bcf..1b47e2f9 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -217,6 +217,9 @@ impl button::StyleSheet for Theme { a: color.a * 0.5, ..color }), + Background::Gradient(gradient) => { + Background::Gradient(gradient.mul_alpha(0.5)) + } }), text_color: Color { a: active.text_color.a * 0.5, -- cgit