pub enum AnimValue {
Float(f32),
Color(Color),
}Expand description
A value the animator can interpolate. Each variant fans out to a fixed number of f32 channels that the integrator steps independently.
Variants§
Implementations§
Source§impl AnimValue
impl AnimValue
Sourcepub fn settle_thresholds(self) -> (f32, f32)
pub fn settle_thresholds(self) -> (f32, f32)
Per-variant (displacement, velocity) settle thresholds for the
spring integrator. Oklab-channeled colors live in a tighter
numeric range than pixel-offset floats, so they get tighter
epsilons.
Sourcepub fn channels(self) -> AnimChannels
pub fn channels(self) -> AnimChannels
Decompose into spring-integrable f32 channels. Colors decompose to [Oklab L, a, b, alpha] so spring physics produces perceptually uniform mid-flight values — no muddy gray midpoint on complementary lerps.
Sourcepub fn from_channels(self, ch: AnimChannels) -> AnimValue
pub fn from_channels(self, ch: AnimChannels) -> AnimValue
Reconstruct an AnimValue of the same variant from sampled
channels. The token name is dropped — an in-flight interpolated
rgba doesn’t equal any palette token’s rgb, so carrying a name
on it would mislead palette resolution. When the animation
settles, step_spring / step_tween assign
self.current = self.target directly, restoring the target’s
token on the final value. Channel space (and the target’s
crate::color::ColorSpace) is recovered from the previous-frame
value (self) so spring overshoot stays in the space the author
authored in.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.