pub enum AnimationPattern {
Pulse {
min_intensity: f32,
max_intensity: f32,
frequency: f32,
},
Flicker {
min_intensity: f32,
max_intensity: f32,
smoothness: f32,
seed: u32,
},
Strobe {
on_intensity: f32,
off_intensity: f32,
frequency: f32,
duty_cycle: f32,
},
Fade {
from_intensity: f32,
to_intensity: f32,
duration: f32,
},
MathDriven {
a: f32,
b: f32,
c: f32,
d: f32,
e: f32,
f: f32,
g: f32,
},
ColorCycle {
colors: Vec<Color>,
cycle_duration: f32,
smooth: bool,
},
Heartbeat {
base_intensity: f32,
peak_intensity: f32,
beat_duration: f32,
pause_duration: f32,
},
}Expand description
Describes an animated light pattern.
Variants§
Pulse
Smooth sinusoidal pulse between min and max intensity.
Flicker
Random flicker with configurable smoothness.
Fields
Strobe
On/off strobe at a fixed frequency.
Fade
Linear fade from one intensity to another over a duration, then hold.
MathDriven
Intensity driven by a mathematical function of time.
Fields
ColorCycle
Cycle through a list of colors over time.
Heartbeat
Heartbeat pattern: two quick pulses then a pause.
Implementations§
Source§impl AnimationPattern
impl AnimationPattern
Sourcepub fn evaluate_intensity(&self, time: f32) -> f32
pub fn evaluate_intensity(&self, time: f32) -> f32
Evaluate intensity at the given elapsed time.
Sourcepub fn evaluate_color(&self, time: f32) -> Option<Color>
pub fn evaluate_color(&self, time: f32) -> Option<Color>
Evaluate color at the given time (only meaningful for ColorCycle).
Trait Implementations§
Source§impl Clone for AnimationPattern
impl Clone for AnimationPattern
Source§fn clone(&self) -> AnimationPattern
fn clone(&self) -> AnimationPattern
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 moreAuto Trait Implementations§
impl Freeze for AnimationPattern
impl RefUnwindSafe for AnimationPattern
impl Send for AnimationPattern
impl Sync for AnimationPattern
impl Unpin for AnimationPattern
impl UnsafeUnpin for AnimationPattern
impl UnwindSafe for AnimationPattern
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