lib8: drop custom RGB8 struct for rgb crate
This commit is contained in:
21
src/main.rs
21
src/main.rs
@@ -1,5 +1,6 @@
|
||||
use palette::Hsv;
|
||||
use palette::convert::IntoColorUnclamped;
|
||||
|
||||
use rgb::RGB8;
|
||||
|
||||
mod power;
|
||||
mod lib8;
|
||||
@@ -9,6 +10,14 @@ mod time;
|
||||
mod geometry;
|
||||
mod platform;
|
||||
|
||||
|
||||
use crate::time::Periodically;
|
||||
use crate::geometry::{Coordinates, VirtualCoordinates};
|
||||
use crate::render::{Shader, Surfaces, Surface};
|
||||
use crate::task::Task;
|
||||
use crate::platform::DisplayInit;
|
||||
use crate::lib8::IntoRgb8;
|
||||
|
||||
#[cfg(feature="embedded-graphics")]
|
||||
mod embedded_graphics_lib;
|
||||
|
||||
@@ -27,12 +36,6 @@ use ws2812_esp32_rmt_driver::lib_smart_leds::Ws2812Esp32Rmt;
|
||||
#[cfg(feature="smart-leds")]
|
||||
use crate::smart_leds_lib::spi::SPIDisplay;
|
||||
|
||||
use crate::time::Periodically;
|
||||
use crate::geometry::{Coordinates, VirtualCoordinates};
|
||||
use crate::render::{Shader, Surfaces, Surface};
|
||||
use crate::task::Task;
|
||||
use crate::platform::DisplayInit;
|
||||
|
||||
#[cfg(feature="threads")]
|
||||
use crate::render::SharedSurface;
|
||||
|
||||
@@ -50,8 +53,8 @@ struct IdleShader {
|
||||
}
|
||||
|
||||
impl Shader for IdleShader {
|
||||
fn draw(&self, coords: VirtualCoordinates) -> lib8::RGB8 {
|
||||
Hsv::new_srgb(self.frame.wrapping_add(coords.x()).wrapping_add(coords.y()), 255, 255).into_color_unclamped()
|
||||
fn draw(&self, coords: VirtualCoordinates) -> RGB8 {
|
||||
Hsv::new_srgb(self.frame.wrapping_add(coords.x()).wrapping_add(coords.y()), 255, 255).into_rgb8()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user