lib8: implement scale8 from fastled

This commit is contained in:
Victoria Fischer 2024-11-16 11:48:11 +01:00
parent 386b454fb7
commit 61b28179d1

View File

@ -2,6 +2,11 @@ use palette::encoding::srgb::Srgb;
use rgb::RGB8;
pub fn scale8(i: u8, scale: u8) -> u8 {
// borrowed from FastLED
(i as u16 * scale as u16).wrapping_shr(8) as u8
}
pub trait Rgb8Blend {
fn saturating_add(self, b: Self) -> Self;
}