diff --git a/src/lib8.rs b/src/lib8.rs index c3184f2..cfa01d4 100644 --- a/src/lib8.rs +++ b/src/lib8.rs @@ -35,35 +35,3 @@ impl IntoRgb8 for palette::Hsv { } } } - -#[cfg(feature="embedded-graphics")] -mod embedded_graphics { - use embedded_graphics::pixelcolor::RgbColor; - use embedded_graphics::pixelcolor::PixelColor; - use embedded_graphics::pixelcolor::raw::RawU8; - - impl RgbColor for RGB8 { - fn r(&self) -> u8 { self.red } - fn g(&self) -> u8 { self.green } - fn b(&self) -> u8 { self.blue } - - const MAX_R: u8 = 255; - const MAX_G: u8 = 255; - const MAX_B: u8 = 255; - - const BLACK: Self = Self::new(0, 0, 0); - const WHITE: Self = Self::new(255, 255, 255); - - const RED: Self = Self::new(255, 0, 0); - const GREEN: Self = Self::new(0, 255, 0); - const BLUE: Self = Self::new(0, 0, 255); - - const YELLOW: Self = Self::new(255, 0, 0); - const CYAN: Self = Self::new(0, 255, 0); - const MAGENTA: Self = Self::new(0, 0, 255); - } - - impl PixelColor for RGB8 { - type Raw = RawU8; - } -} diff --git a/src/platform/embedded_graphics_lib.rs b/src/platform/embedded_graphics_lib.rs index dcac2d1..76358cc 100644 --- a/src/platform/embedded_graphics_lib.rs +++ b/src/platform/embedded_graphics_lib.rs @@ -3,9 +3,11 @@ use embedded_graphics::{ pixelcolor::Rgb888, primitives::Rectangle }; -use embedded_graphics::pixelcolor::RgbColor; +use rgb::RGB8; use ws2812_esp32_rmt_driver::lib_embedded_graphics::{Ws2812DrawTarget, LedPixelShape}; +use esp_idf_svc::hal::prelude::Peripherals; + use running_average::RealTimeRunningAverage; use std::io; @@ -105,7 +107,7 @@ impl Display for EmbeddedDisplay