Tasmota/lib/libesp32/berry_animation/anim_examples/compiled/plasma_wave.be
2025-08-01 23:19:24 +02:00

118 lines
4.7 KiB
Plaintext

# Generated Berry code from Animation DSL
# Source: plasma_wave.anim
# Generated automatically
#
# This file was automatically generated by compile_all_dsl_examples.sh
# Do not edit manually - changes will be overwritten
# Original DSL source:
# # Plasma Wave - Smooth flowing plasma colors
# # Continuous color waves like plasma display
#
# strip length 60
#
# # Define plasma color palette with smooth transitions
# palette plasma_colors = [
# (0, 0xFF0080), # Magenta
# (51, 0xFF8000), # Orange
# (102, 0xFFFF00), # Yellow
# (153, 0x80FF00), # Yellow-green
# (204, 0x00FF80), # Cyan-green
# (255, 0x0080FF) # Blue
# ]
#
# # Base plasma animation with medium speed
# animation plasma_base = rich_palette_animation(plasma_colors, 6s, smooth, 200)
#
# # Add multiple wave layers for complexity
# pattern wave1_pattern = rich_palette_color_provider(plasma_colors, 4s, smooth, 255)
# animation plasma_wave1 = pulse_position_animation(
# wave1_pattern, # color source
# 0, # initial position
# 20, # wide wave
# 10 # very smooth
# )
# plasma_wave1.priority = 10
# plasma_wave1.pos = smooth(0, 40, 8s)
#
# pattern wave2_pattern = rich_palette_color_provider(plasma_colors, 5s, smooth, 180)
# animation plasma_wave2 = pulse_position_animation(
# wave2_pattern, # color source
# 45, # initial position
# 15, # medium wave
# 8 # smooth
# )
# plasma_wave2.priority = 8
# plasma_wave2.pos = smooth(45, 15, 10s) # Opposite direction
#
# pattern wave3_pattern = rich_palette_color_provider(plasma_colors, 3s, smooth, 220)
# animation plasma_wave3 = pulse_position_animation(
# wave3_pattern, # color source
# 20, # initial position
# 12, # smaller wave
# 6 # smooth
# )
# plasma_wave3.priority = 12
# plasma_wave3.pos = smooth(20, 50, 6s) # Different speed
#
# # Add subtle intensity variation
# plasma_base.opacity = smooth(150, 255, 12s)
#
# # Start all animations
# run plasma_base
# run plasma_wave1
# run plasma_wave2
# run plasma_wave3
import animation
# Plasma Wave - Smooth flowing plasma colors
# Continuous color waves like plasma display
var engine = animation.init_strip(60)
# Define plasma color palette with smooth transitions
var plasma_colors_ = bytes("00FF0080" "33FF8000" "66FFFF00" "9980FF00" "CC00FF80" "FF0080FF")
# Base plasma animation with medium speed
var plasma_base_ = animation.rich_palette_animation(animation.global('plasma_colors_', 'plasma_colors'), 6000, animation.global('smooth_', 'smooth'), 200)
# Add multiple wave layers for complexity
var wave1_pattern_ = animation.rich_palette_color_provider(animation.global('plasma_colors_', 'plasma_colors'), 4000, animation.global('smooth_', 'smooth'), 255)
var plasma_wave1_ = animation.pulse_position_animation(animation.global('wave1_pattern_', 'wave1_pattern'), 0, 20, 10)
animation.global('plasma_wave1_').priority = 10
animation.global('plasma_wave1_').pos = animation.smooth(0, 40, 8000)
var wave2_pattern_ = animation.rich_palette_color_provider(animation.global('plasma_colors_', 'plasma_colors'), 5000, animation.global('smooth_', 'smooth'), 180)
var plasma_wave2_ = animation.pulse_position_animation(animation.global('wave2_pattern_', 'wave2_pattern'), 45, 15, 8)
animation.global('plasma_wave2_').priority = 8
animation.global('plasma_wave2_').pos = animation.smooth(45, 15, 10000) # Opposite direction
var wave3_pattern_ = animation.rich_palette_color_provider(animation.global('plasma_colors_', 'plasma_colors'), 3000, animation.global('smooth_', 'smooth'), 220)
var plasma_wave3_ = animation.pulse_position_animation(animation.global('wave3_pattern_', 'wave3_pattern'), 20, 12, 6)
animation.global('plasma_wave3_').priority = 12
animation.global('plasma_wave3_').pos = animation.smooth(20, 50, 6000) # Different speed
# Add subtle intensity variation
animation.global('plasma_base_').opacity = animation.smooth(150, 255, 12000)
# Start all animations
# Start all animations/sequences
if global.contains('sequence_plasma_base')
var seq_manager = global.sequence_plasma_base()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('plasma_base_'))
end
if global.contains('sequence_plasma_wave1')
var seq_manager = global.sequence_plasma_wave1()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('plasma_wave1_'))
end
if global.contains('sequence_plasma_wave2')
var seq_manager = global.sequence_plasma_wave2()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('plasma_wave2_'))
end
if global.contains('sequence_plasma_wave3')
var seq_manager = global.sequence_plasma_wave3()
engine.add_sequence_manager(seq_manager)
else
engine.add_animation(animation.global('plasma_wave3_'))
end
engine.start()