From 0a28f9f5c6e3e27574ac52123a1fc58f0278dc4b Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Wed, 30 Oct 2024 21:55:38 +0100 Subject: [PATCH] platform: smart-leds: implement layer blending --- src/platform/smart_leds_lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/smart_leds_lib.rs b/src/platform/smart_leds_lib.rs index 2ecec97..905d48b 100644 --- a/src/platform/smart_leds_lib.rs +++ b/src/platform/smart_leds_lib.rs @@ -1,6 +1,7 @@ use smart_leds_trait::SmartLedsWrite; use running_average::RealTimeRunningAverage; +use crate::lib8::Rgb8Blend; use crate::render::{Surface, SurfacePool, Display, Surfaces}; use crate::task::Task; use crate::power::{brightness_for_mw, AsMilliwatts}; @@ -79,7 +80,7 @@ impl>, S: Surface> Display for SmartLedDisp let mut pixel = Rgb::new(0, 0, 0); for surface in self.surfaces.iter() { surface.with_shader(|shader| { - pixel = shader.draw(virt_coords.clone()); + pixel = pixel.saturating_add(shader.draw(virt_coords.clone())); }) } self.total_mw += pixel.as_milliwatts();