Rename transparentize to scale_alpha
This commit is contained in:
parent
288025f514
commit
3e99f39a86
4 changed files with 24 additions and 18 deletions
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue