diff --git a/src/main.rs b/src/main.rs index 904c5d0..8f5874b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ mod utils; use animations::Animation; use r2d2::PooledConnection; use utils::ApiResponse; +use render::Lerp; use rocket::{State, serde::json::serde_json::json}; @@ -124,6 +125,10 @@ fn ligth_controll( render.remove_animation(ani.ok().unwrap()); } + println!("aaa"); + + println!("aaa {}", 0.lerp(&255)); + render.render(); } diff --git a/src/render.rs b/src/render.rs index eb7bd7d..2ae1784 100644 --- a/src/render.rs +++ b/src/render.rs @@ -298,13 +298,13 @@ impl Render { } } -trait Lerp { +pub trait Lerp { fn lerp(self, other: &Self) -> Self; } impl Lerp for u8 { fn lerp(self, other: &Self) -> Self { - ((self as f64) + (((*other as f64) - (self as f64)) * 0.2)) as u8 + ((self as f64) + (((*other as f64) - (self as f64)) * 0.1)) as u8 } }