slider animations, ui tweaks

This commit is contained in:
Aleksander
2025-06-28 23:11:37 +02:00
parent 9d0c0f015c
commit 9bbc7b2d22
5 changed files with 133 additions and 21 deletions

View File

@@ -47,9 +47,18 @@ pub struct Color {
}
impl Color {
pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self {
pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Self {
Self { r, g, b, a }
}
pub fn lerp(&self, other: &Color, n: f32) -> Color {
Color {
r: self.r * (1.0 - n) + other.r * n,
g: self.g * (1.0 - n) + other.g * n,
b: self.b * (1.0 - n) + other.b * n,
a: self.a * (1.0 - n) + other.a * n,
}
}
}
impl Default for Color {