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

32 lines
939 B
Plaintext

# Fire Flicker - Realistic fire simulation
# Warm colors with random flickering intensity
strip length 60
# Define fire palette from black to yellow
palette fire_colors = [
(0, 0x000000), # Black
(64, 0x800000), # Dark red
(128, 0xFF0000), # Red
(192, 0xFF4500), # Orange red
(255, 0xFFFF00) # Yellow
]
# Create base fire animation with palette
animation fire_base = rich_palette_animation(fire_colors, 3s, linear, 255)
# Add flickering effect with random intensity changes
fire_base.opacity = smooth(180, 255, 800ms)
# Add subtle position variation for more realism
pattern flicker_pattern = rich_palette_color_provider(fire_colors, 2s, linear, 255)
animation fire_flicker = twinkle_animation(
flicker_pattern, # color source
12, # density (number of flickers)
200ms # twinkle speed (flicker duration)
)
fire_flicker.priority = 10
# Start both animations
run fire_base
run fire_flicker