lib8: change saturating_add to use by-value instead of by-ref

This commit is contained in:
Victoria Fischer 2024-11-16 11:43:38 +01:00
parent 52434577cd
commit a64a449da4

View File

@ -3,11 +3,11 @@ use palette::encoding::srgb::Srgb;
use rgb::RGB8;
pub trait Rgb8Blend {
fn saturating_add(&self, b: Self) -> Self;
fn saturating_add(self, b: Self) -> Self;
}
impl Rgb8Blend for RGB8 {
fn saturating_add(&self, b: Self) -> Self {
fn saturating_add(self, b: Self) -> Self {
RGB8::new(self.r.saturating_add(b.r), self.g.saturating_add(b.g), self.b.saturating_add(b.b))
}
}