pub struct AnimValue(pub [f32; 4]);Expand description
Generic animatable payload; every property (color, scale, opacity…) is flattened into up to 4 floats so the manager can interpolate anything without knowing what it represents.
Tuple Fields§
§0: [f32; 4]Implementations§
Source§impl AnimValue
impl AnimValue
Sourcepub fn lerp(self, other: Self, t: f32) -> Self
pub fn lerp(self, other: Self, t: f32) -> Self
Linearly interpolates component-wise between self and other.
t is expected to lie in [0.0, 1.0] but is not clamped here, so
callers relying on overshoot easings can pass values outside that
range and get correct extrapolation.
Sourcepub fn lerp_premultiplied(self, other: Self, t: f32) -> Self
pub fn lerp_premultiplied(self, other: Self, t: f32) -> Self
Interpolates two RGBA colors (packed as [r, g, b, a]) using premultiplied alpha. A straight per-channel lerp drags the RGB toward whichever endpoint has near-zero alpha (its RGB is otherwise meaningless), which shows up as a dark flash mid-fade whenever one endpoint is transparent.
Trait Implementations§
impl Copy for AnimValue
impl StructuralPartialEq for AnimValue
Auto Trait Implementations§
impl Freeze for AnimValue
impl RefUnwindSafe for AnimValue
impl Send for AnimValue
impl Sync for AnimValue
impl Unpin for AnimValue
impl UnsafeUnpin for AnimValue
impl UnwindSafe for AnimValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more