Tasmota/lib/libesp32/berry_animation/anim_examples/compiled/pattern_fire.be
2025-08-29 23:10:41 +02:00

42 lines
1.3 KiB
Plaintext

# Generated Berry code from Animation DSL
# Source: pattern_fire.anim
#
# This file was automatically generated by compile_all_examples.sh
# Do not edit manually - changes will be overwritten
import animation
# Pattern fire.anim
# Define fire palette from black to yellow
# Auto-generated strip initialization (using Tasmota configuration)
var engine = animation.init_strip()
var fire_colors_ = bytes("FF800000" "FFFF0000" "FFFF4500" "FFFFFF00")
var strip_len_ = animation.strip_length(engine)
var fire_color_ = animation.rich_palette(engine)
fire_color_.palette = fire_colors_
var fire_pattern_ = animation.palette_gradient_animation(engine)
fire_pattern_.color_source = fire_color_
fire_pattern_.spatial_period = animation.create_closure_value(engine, def (self) return self.resolve(strip_len_) / 2 end)
engine.add_animation(fire_pattern_)
engine.start()
#- Original DSL source:
# Pattern fire.anim
# Define fire palette from black to yellow
palette fire_colors = [
0x800000 # Dark red
0xFF0000 # Red
0xFF4500 # Orange red
0xFFFF00 # Yellow
]
set strip_len = strip_length()
color fire_color = rich_palette(palette=fire_colors)
animation fire_pattern = palette_gradient_animation(color_source=fire_color, spatial_period=strip_len/2)
run fire_pattern
-#