#[non_exhaustive]pub enum KeyframeValue {
Scalar(f32),
Vec2(f32, f32),
Color(u32),
Discrete(String),
}Expand description
Typed keyframe value. interpolate is invoked by Animation
between two keyframes of the same variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Scalar(f32)
Vec2(f32, f32)
Color(u32)
0xRRGGBBAA colour, interpolated per-channel in linear space.
Discrete(String)
Held value — interpolate returns a below 1.0 and b at 1.0.
Use for “step” transitions.
Implementations§
Source§impl KeyframeValue
impl KeyframeValue
pub fn interpolate( a: &KeyframeValue, b: &KeyframeValue, t: f32, ) -> KeyframeValue
Trait Implementations§
Source§impl Clone for KeyframeValue
impl Clone for KeyframeValue
Source§fn clone(&self) -> KeyframeValue
fn clone(&self) -> KeyframeValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyframeValue
impl Debug for KeyframeValue
Source§impl PartialEq for KeyframeValue
impl PartialEq for KeyframeValue
impl StructuralPartialEq for KeyframeValue
Auto Trait Implementations§
impl Freeze for KeyframeValue
impl RefUnwindSafe for KeyframeValue
impl Send for KeyframeValue
impl Sync for KeyframeValue
impl Unpin for KeyframeValue
impl UnsafeUnpin for KeyframeValue
impl UnwindSafe for KeyframeValue
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