Tasmota/lib/libesp32/berry_animation/anim_examples/sunrise_sunset.anim

57 lines
1.8 KiB
Plaintext

# Sunrise Sunset - Warm color transition
# Gradual transition from night to day colors
#strip length 60
# Define time-of-day color palette
palette daylight_colors = [
(0, 0x000011), # Night - dark blue
(32, 0x001133), # Pre-dawn
(64, 0xFF4400), # Sunrise orange
(96, 0xFFAA00), # Morning yellow
(128, 0xFFFF88), # Midday bright
(160, 0xFFAA44), # Afternoon
(192, 0xFF6600), # Sunset orange
(224, 0xAA2200), # Dusk red
(255, 0x220011) # Night - dark red
]
# Main daylight cycle - very slow transition
animation daylight_cycle = rich_palette(colors=daylight_colors, period=60s)
# Add sun position effect - bright spot that moves
animation sun_position = beacon(
color=0xFFFFAA # Bright yellow sun
pos=5 # initial position
beacon_size=8 # sun size
slew_size=4 # soft glow
)
sun_position.priority = 10
sun_position.pos = smooth(min_value=5, max_value=55, duration=30s) # Sun arc across sky
sun_position.opacity = smooth(min_value=0, max_value=255, duration=30s) # Fade in and out
# Add atmospheric glow around sun
animation sun_glow = beacon(
color=0xFFCC88 # Warm glow
pos=5 # initial position
beacon_size=16 # larger glow
slew_size=8 # very soft
)
sun_glow.priority = 5
sun_glow.pos = smooth(min_value=5, max_value=55, duration=30s) # Follow sun
sun_glow.opacity = smooth(min_value=0, max_value=150, duration=30s) # Dimmer glow
# Add twinkling stars during night phases
animation stars = twinkle(
color=0xFFFFFF # White stars
density=6 # density (star count)
twinkle_speed=1s # twinkle speed (slow twinkle)
)
stars.priority = 15
stars.opacity = smooth(min_value=255, max_value=0, duration=30s) # Fade out during day
# Start all animations
run daylight_cycle
run sun_position
run sun_glow
run stars