lib8: change saturating_add to use by-value instead of by-ref
This commit is contained in:
parent
52434577cd
commit
a64a449da4
@ -3,11 +3,11 @@ use palette::encoding::srgb::Srgb;
|
|||||||
use rgb::RGB8;
|
use rgb::RGB8;
|
||||||
|
|
||||||
pub trait Rgb8Blend {
|
pub trait Rgb8Blend {
|
||||||
fn saturating_add(&self, b: Self) -> Self;
|
fn saturating_add(self, b: Self) -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Rgb8Blend for RGB8 {
|
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))
|
RGB8::new(self.r.saturating_add(b.r), self.g.saturating_add(b.g), self.b.saturating_add(b.b))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user