Combine colors with saturation, not overflow

This commit is contained in:
2026-10-31 12:35:03 -04:00
parent bdec3baa74
commit 63d923ad10
3 changed files with 4 additions and 21 deletions
+1 -5
View File
@@ -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 {