1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! RGB LED ring effects and animations.
//!
//! This crate provides reusable animation effects for circular LED rings.
//! It is `no_std` compatible for embedded use.
//!
//! All effects implement the [`Effect`] trait, which provides a uniform
//! interface for rendering animations into an `RGB8` buffer.
//!
//! # Available Effects
//!
//! - [`RainbowEffect`] — smooth rainbow gradient rotation
//! - [`PulseEffect`] — heartbeat animation: sine-wave brightness with a pause at the floor
//! - [`BreatheEffect`] — breathing animation: symmetric full-sine brightness with no pause
//! - [`SpinnerEffect`] — rotating dot with fading tail (linear decay, brightness floor)
//! - [`MeteorEffect`] — meteor / comet: bright head with exponentially-decaying tail
//! - [`TwinkleEffect`] — ambient sparkle: random LEDs flash to peak brightness then decay
//! - [`FireEffect`] — fire simulation: heat diffuses upward from a sparking base
//! - [`CylonEffect`] — Cylon / bouncing scanner: bright head sweeps back and forth with fading tail
//! - [`KnightRiderEffect`] — Knight Rider / dual-headed scanner: two heads sweep in opposite directions
//! - [`ChaseEffect`] — moving a solid segment around the ring
//! - [`FlashEffect`] — rapid on/off toggle with configurable duty cycle
//! - [`ProgressEffect`] — proportional ring fill
//! - [`SectionEffect`] — weighted color sections on a ring
//! - [`RainbowCometEffect`] — Rainbow comet: orbiting head with a hue-cycling fading tail
//!
//! # Utilities
//!
//! - [`ColorPalette`] — three-color theme for effects
//! - [`fill_solid`] — fill a buffer with a single color
//! - [`sine_wave`] — half-wave rectified sine lookup (0→255→0 then plateau at 0)
//! - [`sine_full`] — full symmetric sine lookup (0→255→0, no plateau)
//! - [`scale_brightness`] — scale an RGB color's brightness
//! - [`lerp_color`] — linearly interpolate between two colors
//!
//! # Color type
//!
//! All effects operate on [`RGB8`], re-exported here from the [`rgb`] crate.
//! Downstream crates do not need a direct `rgb` dependency — `use ferriswheel::RGB8`
//! is sufficient.
//!
//! # Example
//!
//! ```
//! use ferriswheel::{Effect, RainbowEffect, Direction, RGB8};
//!
//! let mut rainbow = RainbowEffect::new(12).unwrap();
//! let mut buffer = [RGB8::default(); 12];
//!
//! // Fill the buffer with rainbow colors and advance animation
//! rainbow.update(&mut buffer).unwrap();
//!
//! // Use as a trait object
//! let effect: &dyn Effect = &rainbow;
//! effect.current(&mut buffer).unwrap();
//! ```
pub use RGB8;
pub use BreatheEffect;
pub use ChaseEffect;
pub use CylonEffect;
pub use ;
pub use FireEffect;
pub use FlashEffect;
pub use hsv_to_rgb;
pub use KnightRiderEffect;
pub use MeteorEffect;
pub use ColorPalette;
pub use ProgressEffect;
pub use PulseEffect;
pub use RainbowEffect;
pub use RainbowCometEffect;
pub use ;
pub use SpinnerEffect;
pub use TwinkleEffect;
pub use ;
// When `smart-leds-compat` is enabled, this forces `smart-leds-trait` into the
// dependency graph and makes compilation fail if its `rgb::RGB8` differs from
// ours — i.e. if the two crates resolve to incompatible `rgb` versions.