use color::{AlphaColor, ColorSpace};
pub trait Interpolatable {
fn lerp(&self, target: &Self, t: f32) -> Self;
}
impl Interpolatable for f32 {
fn lerp(&self, target: &Self, t: f32) -> Self {
self + (target - self) * t
}
}
impl<CS: ColorSpace> Interpolatable for AlphaColor<CS> {
fn lerp(&self, other: &Self, t: f32) -> Self {
// TODO: figure out to use `lerp_rect` or `lerp`
AlphaColor::lerp_rect(*self, *other, t)
}
}