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

66 lines
1.3 KiB
Plaintext

# Demo Shutter Rainbow
#
# Shutter from left to right iterating in all colors
template shutter_left_right {
param colors type palette
param duration
set strip_len = strip_length()
set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration)
color col1 = color_cycle(palette=colors, cycle_period=0)
color col2 = color_cycle(palette=colors, cycle_period=0)
col2.next = 1
animation shutter_lr_animation = beacon_animation(
color = col2
back_color = col1
pos = 0
beacon_size = shutter_size
slew_size = 0
priority = 5
)
animation shutter_rl_animation = beacon_animation(
color = col1
back_color = col2
pos = 0
beacon_size = strip_len - shutter_size
slew_size = 0
priority = 5
)
sequence shutter_seq {
#repeat col1.palette_size times {
repeat 7 times {
reset shutter_size
play shutter_lr_animation for duration
col1.next = 1
col2.next = 1
}
repeat col1.palette_size times {
reset shutter_size
play shutter_rl_animation for duration
col1.next = 1
col2.next = 1
}
}
run shutter_seq
}
color Violet = 0x112233
palette rainbow_with_white = [
red
orange
yellow
green
blue
indigo
white
]
shutter_left_right(rainbow_with_white, 1.5s)