diff --git a/CHANGELOG.md b/CHANGELOG.md index da559f8..5b24a32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ This release has an [MSRV][] of 1.82. * Add `BLACK`, `WHITE`, and `TRANSPARENT` constants to the color types. ([#64][] by [@waywardmonkeys][]) +### Changed + +* The `mul_alpha` method was renamed to `multiply_alpha`. ([#65][] by [@waywardmonkeys][]) + ## [0.1.0][] (2024-11-20) This release has an [MSRV][] of 1.82. @@ -28,6 +32,7 @@ This is the initial release. [@waywardmonkeys]: https://github.com/waywardmonkeys [#64]: https://github.com/linebender/color/pull/64 +[#65]: https://github.com/linebender/color/pull/65 [Unreleased]: https://github.com/linebender/color/compare/v0.1.0...HEAD [0.1.0]: https://github.com/linebender/color/releases/tag/v0.1.0 diff --git a/color/src/color.rs b/color/src/color.rs index 22ba77b..8b6dd22 100644 --- a/color/src/color.rs +++ b/color/src/color.rs @@ -387,7 +387,7 @@ impl AlphaColor { /// Multiply alpha by the given factor. #[must_use] - pub const fn mul_alpha(self, rhs: f32) -> Self { + pub const fn multiply_alpha(self, rhs: f32) -> Self { let (opaque, alpha) = split_alpha(self.components); Self::new(add_alpha(opaque, alpha * rhs)) } @@ -555,7 +555,7 @@ impl PremulColor { /// Multiply alpha by the given factor. #[must_use] - pub const fn mul_alpha(self, rhs: f32) -> Self { + pub const fn multiply_alpha(self, rhs: f32) -> Self { let (multiplied, alpha) = split_alpha(self.components); Self::new(add_alpha(CS::LAYOUT.scale(multiplied, rhs), alpha * rhs)) } @@ -686,7 +686,7 @@ impl core::ops::Sub for AlphaColor { /// Multiply components by a scalar. /// /// For rectangular color spaces, this is equivalent to multiplying -/// alpha, but for cylindrical color spaces, [`PremulColor::mul_alpha`] +/// alpha, but for cylindrical color spaces, [`PremulColor::multiply_alpha`] /// is the preferred method. impl core::ops::Mul for PremulColor { type Output = Self;