# Generated Berry code from Animation DSL # Source: simple_palette.anim # # This file was automatically generated by compile_all_examples.sh # Do not edit manually - changes will be overwritten import animation # Simple Palette Example # Demonstrates basic palette usage in the DSL #strip length 20 # Define a simple rainbow palette # Auto-generated strip initialization (using Tasmota configuration) var engine = animation.init_strip() var rainbow_ = bytes("00FF0000" "40FFA500" "80FFFF00" "C0008000" "FF0000FF") # Create an animation using the palette var rainbow_cycle_ = animation.rich_palette_animation(engine) rainbow_cycle_.colors = rainbow_ rainbow_cycle_.period = 3000 # Simple sequence var demo_ = animation.sequence_manager(engine) .push_play_step(rainbow_cycle_, 15000) engine.add(demo_) engine.run() #- Original DSL source: # Simple Palette Example # Demonstrates basic palette usage in the DSL #strip length 20 # Define a simple rainbow palette palette rainbow = [ (0, red), (64, orange), (128, yellow), (192, green), (255, blue) ] # Create an animation using the palette animation rainbow_cycle = rich_palette_animation(colors=rainbow, period=3s) # Simple sequence sequence demo { play rainbow_cycle for 15s } run demo -#