Combine colors with saturation, not overflow
This commit is contained in:
+1
-5
@@ -220,11 +220,7 @@ impl ImageBuffer {
|
||||
pub fn add(&mut self, coords: (usize, usize), pixel: Color32) {
|
||||
let index = coords.1 * self.size[0] + coords.0;
|
||||
let old = self.pixels[index];
|
||||
self.pixels[index] = Color32::from_rgb(
|
||||
old.r() + pixel.r(),
|
||||
old.g() + pixel.g(),
|
||||
old.b() + pixel.b(),
|
||||
);
|
||||
self.pixels[index] = old + pixel;
|
||||
}
|
||||
|
||||
pub fn changed(&self, image: &ColorImage) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user