summaryrefslogtreecommitdiffstats
path: root/core/src/background.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-08 13:40:10 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-08 13:40:10 +0100
commit3e99f39a8680bb48d5c15b043c399a3337765ae5 (patch)
treefbf1dd4d7fbe5f64c6931dbc933c0c21dfffc120 /core/src/background.rs
parent288025f5143f4e3f8bc5af36e86f7afa7f07a4c7 (diff)
downloadiced-3e99f39a8680bb48d5c15b043c399a3337765ae5.tar.gz
iced-3e99f39a8680bb48d5c15b043c399a3337765ae5.tar.bz2
iced-3e99f39a8680bb48d5c15b043c399a3337765ae5.zip
Rename `transparentize` to `scale_alpha`
Diffstat (limited to 'core/src/background.rs')
-rw-r--r--core/src/background.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/background.rs b/core/src/background.rs
index 2e28e560..eb4b5021 100644
--- a/core/src/background.rs
+++ b/core/src/background.rs
@@ -12,13 +12,13 @@ pub enum Background {
}
impl Background {
- /// Increases the translucency of the [`Background`]
- /// by the given factor.
- pub fn transparentize(self, factor: f32) -> Self {
+ /// Scales the the alpha channel of the [`Background`] by the given
+ /// factor.
+ pub fn scale_alpha(self, factor: f32) -> Self {
match self {
- Self::Color(color) => Self::Color(color.transparentize(factor)),
+ Self::Color(color) => Self::Color(color.scale_alpha(factor)),
Self::Gradient(gradient) => {
- Self::Gradient(gradient.transparentize(factor))
+ Self::Gradient(gradient.scale_alpha(factor))
}
}
}