use okchla color for better movement between shades

main
Elijah Voigt 2 months ago
parent d4cfeb42ff
commit 3d12aebec9

@ -1275,14 +1275,11 @@ fn debug_trail(
fn shimmer_button<T: Component>(mut bg: Single<&mut BackgroundColor, With<T>>, time: Res<Time>) {
let t = time.elapsed_secs();
let period = 3.0;
let red = (((t / period) % 1.0) * std::f32::consts::PI).cos();
let green = ((((t / period) + 0.3) % 1.0) * std::f32::consts::PI).cos();
let blue = ((((t / period) + 0.6) % 1.0) * std::f32::consts::PI).cos();
bg.0 = Srgba {
red,
green,
blue,
let lightness = 0.5;
let chroma = 0.5;
let hue = (t * 60.0) % 360.0;
bg.0 = Oklcha {
lightness, chroma, hue,
alpha: bg.0.alpha(),
}
.into();

Loading…
Cancel
Save