Tasmota/lib/libesp32/berry_animation/anim_examples/lightning_storm.anim
2025-08-01 19:34:23 +02:00

48 lines
1.4 KiB
Plaintext

# Lightning Storm - Random lightning flashes
# Dark stormy background with bright lightning
strip length 60
# Dark stormy background with subtle purple/blue
palette storm_colors = [
(0, 0x000011), # Very dark blue
(128, 0x110022), # Dark purple
(255, 0x220033) # Slightly lighter purple
]
animation storm_bg = rich_palette_animation(storm_colors, 12s, smooth, 100)
# Random lightning flashes - full strip
animation lightning_main = solid(0xFFFFFF) # Bright white
lightning_main.opacity = square(0, 255, 80ms, 3) # Quick bright flashes
lightning_main.priority = 20
# Secondary lightning - partial strip
animation lightning_partial = pulse_position_animation(
0xFFFFAA, # Slightly yellow white
30, # center position
20, # covers part of strip
5 # soft edges
)
lightning_partial.priority = 15
lightning_partial.opacity = square(0, 200, 120ms, 4) # Different timing
# Add blue afterglow
animation afterglow = solid(0x4444FF) # Blue glow
afterglow.opacity = square(0, 80, 200ms, 8) # Longer, dimmer glow
afterglow.priority = 10
# Distant thunder (dim flashes)
animation distant_flash = twinkle_animation(
0x666699, # Dim blue-white
4, # density (few flashes)
300ms # twinkle speed (medium duration)
)
distant_flash.priority = 5
# Start all animations
run storm_bg
run lightning_main
run lightning_partial
run afterglow
run distant_flash