summaryrefslogtreecommitdiffstats
path: root/core/src/gradient.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-04 20:42:37 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-04 20:42:37 +0100
commitf4a4845ddbdced81ae4ff60bfa19f0e602d84709 (patch)
treeb532017384eb9e43e57bf73be372aea0d55af652 /core/src/gradient.rs
parentdb92e1c942154bee474fee5e2c187f8a52a1bb96 (diff)
downloadiced-f4a4845ddbdced81ae4ff60bfa19f0e602d84709.tar.gz
iced-f4a4845ddbdced81ae4ff60bfa19f0e602d84709.tar.bz2
iced-f4a4845ddbdced81ae4ff60bfa19f0e602d84709.zip
Simplify theming for `Button` widget
Diffstat (limited to 'core/src/gradient.rs')
-rw-r--r--core/src/gradient.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/gradient.rs b/core/src/gradient.rs
index 4711b044..ecf7830f 100644
--- a/core/src/gradient.rs
+++ b/core/src/gradient.rs
@@ -13,11 +13,11 @@ pub enum Gradient {
impl Gradient {
/// Adjust the opacity of the gradient by a multiplier applied to each color stop.
- pub fn mul_alpha(mut self, alpha_multiplier: f32) -> Self {
+ pub fn transparentize(mut self, factor: f32) -> Self {
match &mut self {
Gradient::Linear(linear) => {
for stop in linear.stops.iter_mut().flatten() {
- stop.color.a *= alpha_multiplier;
+ stop.color.a *= factor;
}
}
}