Berry animation start renaming classes (#24295)

This commit is contained in:
s-hadinger 2026-01-03 11:04:32 +01:00 committed by GitHub
parent 3503cee120
commit 219cdfd57a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
73 changed files with 5570 additions and 5925 deletions

View File

@ -160,9 +160,9 @@ Animation|Description
`beacon_animation`|Pulse/highlight at specific position with optional slew `beacon_animation`|Pulse/highlight at specific position with optional slew
`crenel_animation`|Crenel/square wave pattern `crenel_animation`|Crenel/square wave pattern
`comet_animation`|Moving comet with fading tail `comet_animation`|Moving comet with fading tail
`twinkle_animation`|Twinkling stars effect `twinkle`|Twinkling stars effect
`fire_animation`|Realistic fire simulation `fire_animation`|Realistic fire simulation
`rich_palette`|Smooth palette color transitions `rich_palette_color`|Smooth palette color transitions
`gradient_animation`|Linear or radial color gradients `gradient_animation`|Linear or radial color gradients
`palette_gradient_animation`|Gradient patterns with palette colors `palette_gradient_animation`|Gradient patterns with palette colors
`palette_meter_animation`|Meter/bar patterns `palette_meter_animation`|Meter/bar patterns

View File

@ -21,7 +21,7 @@ palette breathe_palette = [
] ]
# Create a rich palette color provider # Create a rich palette color provider
color palette_pattern = rich_palette( color palette_pattern = rich_palette_color(
colors=breathe_palette # palette colors=breathe_palette # palette
period=15s # cycle period (defaults: smooth transition, 255 brightness) period=15s # cycle period (defaults: smooth transition, 255 brightness)
) )

View File

@ -17,8 +17,8 @@ palette ornament_colors = [
] ]
# Colorful ornaments as twinkling lights # Colorful ornaments as twinkling lights
color ornament_pattern = rich_palette(colors=ornament_colors, period=3s, transition_type=LINEAR, brightness=255) color ornament_pattern = rich_palette_color(colors=ornament_colors, period=3s, transition_type=LINEAR, brightness=255)
animation ornaments = twinkle_animation( animation ornaments = twinkle(
color=ornament_pattern # color source color=ornament_pattern # color source
density=15 # density (many ornaments) density=15 # density (many ornaments)
twinkle_speed=800ms # twinkle speed (slow twinkle) twinkle_speed=800ms # twinkle speed (slow twinkle)
@ -36,7 +36,7 @@ tree_star.priority = 20
tree_star.opacity = smooth(min_value=200, max_value=255, duration=2s) # Gentle pulsing tree_star.opacity = smooth(min_value=200, max_value=255, duration=2s) # Gentle pulsing
# Add some white sparkles for snow/magic # Add some white sparkles for snow/magic
animation snow_sparkles = twinkle_animation( animation snow_sparkles = twinkle(
color=0xFFFFFF # White snow color=0xFFFFFF # White snow
density=8 # density (sparkle count) density=8 # density (sparkle count)
twinkle_speed=400ms # twinkle speed (quick sparkles) twinkle_speed=400ms # twinkle speed (quick sparkles)
@ -44,7 +44,7 @@ animation snow_sparkles = twinkle_animation(
snow_sparkles.priority = 15 snow_sparkles.priority = 15
# Garland effect - moving colored lights # Garland effect - moving colored lights
color garland_pattern = rich_palette(colors=ornament_colors, period=2s, transition_type=LINEAR, brightness=200) color garland_pattern = rich_palette_color(colors=ornament_colors, period=2s, transition_type=LINEAR, brightness=200)
animation garland = comet_animation( animation garland = comet_animation(
color=garland_pattern # color source color=garland_pattern # color source
tail_length=6 # garland length (tail length) tail_length=6 # garland length (tail length)

View File

@ -25,7 +25,7 @@ animation comet_secondary = comet_animation(
) )
# Add sparkle trail behind comets but on top of blue background # Add sparkle trail behind comets but on top of blue background
animation comet_sparkles = twinkle_animation( animation comet_sparkles = twinkle(
color=0xAAAAFF # Light blue sparkles color=0xAAAAFF # Light blue sparkles
density=8 # density (moderate sparkles) density=8 # density (moderate sparkles)
twinkle_speed=400ms # twinkle speed (quick sparkle) twinkle_speed=400ms # twinkle speed (quick sparkle)

View File

@ -28,7 +28,7 @@ var breathe_palette_ = bytes(
"FF800080" # Purple "FF800080" # Purple
) )
# Create a rich palette color provider # Create a rich palette color provider
var palette_pattern_ = animation.rich_palette(engine) var palette_pattern_ = animation.rich_palette_color(engine)
palette_pattern_.colors = breathe_palette_ # palette palette_pattern_.colors = breathe_palette_ # palette
palette_pattern_.period = 15000 # cycle period (defaults: smooth transition, 255 brightness) palette_pattern_.period = 15000 # cycle period (defaults: smooth transition, 255 brightness)
# Create breathing animation using the palette # Create breathing animation using the palette
@ -74,7 +74,7 @@ palette breathe_palette = [
] ]
# Create a rich palette color provider # Create a rich palette color provider
color palette_pattern = rich_palette( color palette_pattern = rich_palette_color(
colors=breathe_palette # palette colors=breathe_palette # palette
period=15s # cycle period (defaults: smooth transition, 255 brightness) period=15s # cycle period (defaults: smooth transition, 255 brightness)
) )

View File

@ -25,12 +25,12 @@ var ornament_colors_ = bytes(
"FFFF00FF" # Magenta "FFFF00FF" # Magenta
) )
# Colorful ornaments as twinkling lights # Colorful ornaments as twinkling lights
var ornament_pattern_ = animation.rich_palette(engine) var ornament_pattern_ = animation.rich_palette_color(engine)
ornament_pattern_.colors = ornament_colors_ ornament_pattern_.colors = ornament_colors_
ornament_pattern_.period = 3000 ornament_pattern_.period = 3000
ornament_pattern_.transition_type = animation.LINEAR ornament_pattern_.transition_type = animation.LINEAR
ornament_pattern_.brightness = 255 ornament_pattern_.brightness = 255
var ornaments_ = animation.twinkle_animation(engine) var ornaments_ = animation.twinkle(engine)
ornaments_.color = ornament_pattern_ # color source ornaments_.color = ornament_pattern_ # color source
ornaments_.density = 15 # density (many ornaments) ornaments_.density = 15 # density (many ornaments)
ornaments_.twinkle_speed = 800 # twinkle speed (slow twinkle) ornaments_.twinkle_speed = 800 # twinkle speed (slow twinkle)
@ -50,13 +50,13 @@ tree_star_.opacity = (def (engine)
return provider return provider
end)(engine) # Gentle pulsing end)(engine) # Gentle pulsing
# Add some white sparkles for snow/magic # Add some white sparkles for snow/magic
var snow_sparkles_ = animation.twinkle_animation(engine) var snow_sparkles_ = animation.twinkle(engine)
snow_sparkles_.color = 0xFFFFFFFF # White snow snow_sparkles_.color = 0xFFFFFFFF # White snow
snow_sparkles_.density = 8 # density (sparkle count) snow_sparkles_.density = 8 # density (sparkle count)
snow_sparkles_.twinkle_speed = 400 # twinkle speed (quick sparkles) snow_sparkles_.twinkle_speed = 400 # twinkle speed (quick sparkles)
snow_sparkles_.priority = 15 snow_sparkles_.priority = 15
# Garland effect - moving colored lights # Garland effect - moving colored lights
var garland_pattern_ = animation.rich_palette(engine) var garland_pattern_ = animation.rich_palette_color(engine)
garland_pattern_.colors = ornament_colors_ garland_pattern_.colors = ornament_colors_
garland_pattern_.period = 2000 garland_pattern_.period = 2000
garland_pattern_.transition_type = animation.LINEAR garland_pattern_.transition_type = animation.LINEAR
@ -95,8 +95,8 @@ palette ornament_colors = [
] ]
# Colorful ornaments as twinkling lights # Colorful ornaments as twinkling lights
color ornament_pattern = rich_palette(colors=ornament_colors, period=3s, transition_type=LINEAR, brightness=255) color ornament_pattern = rich_palette_color(colors=ornament_colors, period=3s, transition_type=LINEAR, brightness=255)
animation ornaments = twinkle_animation( animation ornaments = twinkle(
color=ornament_pattern # color source color=ornament_pattern # color source
density=15 # density (many ornaments) density=15 # density (many ornaments)
twinkle_speed=800ms # twinkle speed (slow twinkle) twinkle_speed=800ms # twinkle speed (slow twinkle)
@ -114,7 +114,7 @@ tree_star.priority = 20
tree_star.opacity = smooth(min_value=200, max_value=255, duration=2s) # Gentle pulsing tree_star.opacity = smooth(min_value=200, max_value=255, duration=2s) # Gentle pulsing
# Add some white sparkles for snow/magic # Add some white sparkles for snow/magic
animation snow_sparkles = twinkle_animation( animation snow_sparkles = twinkle(
color=0xFFFFFF # White snow color=0xFFFFFF # White snow
density=8 # density (sparkle count) density=8 # density (sparkle count)
twinkle_speed=400ms # twinkle speed (quick sparkles) twinkle_speed=400ms # twinkle speed (quick sparkles)
@ -122,7 +122,7 @@ animation snow_sparkles = twinkle_animation(
snow_sparkles.priority = 15 snow_sparkles.priority = 15
# Garland effect - moving colored lights # Garland effect - moving colored lights
color garland_pattern = rich_palette(colors=ornament_colors, period=2s, transition_type=LINEAR, brightness=200) color garland_pattern = rich_palette_color(colors=ornament_colors, period=2s, transition_type=LINEAR, brightness=200)
animation garland = comet_animation( animation garland = comet_animation(
color=garland_pattern # color source color=garland_pattern # color source
tail_length=6 # garland length (tail length) tail_length=6 # garland length (tail length)

View File

@ -30,7 +30,7 @@ comet_secondary_.speed = 3000 # slower speed
comet_secondary_.direction = (-1) # other direction comet_secondary_.direction = (-1) # other direction
comet_secondary_.priority = 5 comet_secondary_.priority = 5
# Add sparkle trail behind comets but on top of blue background # Add sparkle trail behind comets but on top of blue background
var comet_sparkles_ = animation.twinkle_animation(engine) var comet_sparkles_ = animation.twinkle(engine)
comet_sparkles_.color = 0xFFAAAAFF # Light blue sparkles comet_sparkles_.color = 0xFFAAAAFF # Light blue sparkles
comet_sparkles_.density = 8 # density (moderate sparkles) comet_sparkles_.density = 8 # density (moderate sparkles)
comet_sparkles_.twinkle_speed = 400 # twinkle speed (quick sparkle) comet_sparkles_.twinkle_speed = 400 # twinkle speed (quick sparkle)
@ -71,7 +71,7 @@ animation comet_secondary = comet_animation(
) )
# Add sparkle trail behind comets but on top of blue background # Add sparkle trail behind comets but on top of blue background
animation comet_sparkles = twinkle_animation( animation comet_sparkles = twinkle(
color=0xAAAAFF # Light blue sparkles color=0xAAAAFF # Light blue sparkles
density=8 # density (moderate sparkles) density=8 # density (moderate sparkles)
twinkle_speed=400ms # twinkle speed (quick sparkle) twinkle_speed=400ms # twinkle speed (quick sparkle)

View File

@ -10,19 +10,19 @@ This document contains a summary of the DSL compilation process, including symbo
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|----------------------------|---------|-----------|------------| |----------------------|----------------------------|---------|-----------|------------|
| `breathe_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `breathe_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `breathe_blue` | color | | | | | `breathe_blue` | color | | | |
| `breathe_green` | color | | | | | `breathe_green` | color | | | |
| `breathe_orange` | color | | | | | `breathe_orange` | color | | | |
| `breathe_palette` | palette | | | | | `breathe_palette` | palette | | | |
| `breathe_purple` | color | | | | | `breathe_purple` | color | | | |
| `breathe_red` | color | | | | | `breathe_red` | color | | | |
| `breathing` | animation | | | | | `breathing` | animation | | | |
| `palette_pattern` | color | | | | | `palette_pattern` | color | | | |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -67,24 +67,24 @@ SUCCESS
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|----------------------------|---------|-----------|------------| |----------------------|----------------------------|---------|-----------|------------|
| `LINEAR` | constant | ✓ | | | | `LINEAR` | constant | ✓ | | |
| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `garland_pattern` | color | | | | | `garland_pattern` | color | | | |
| `garland` | animation | | | | | `garland` | animation | | | |
| `ornament_colors` | palette | | | | | `ornament_colors` | palette | | | |
| `ornament_pattern` | color | | | | | `ornament_pattern` | color | | | |
| `ornaments` | animation | | | | | `ornaments` | animation | | | |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `snow_sparkles` | animation | | | | | `snow_sparkles` | animation | | | |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `tree_base` | animation | | | | | `tree_base` | animation | | | |
| `tree_green` | color | | | | | `tree_green` | color | | | |
| `tree_star` | animation | | | | | `tree_star` | animation | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -98,16 +98,16 @@ SUCCESS
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|-----------------------|---------|-----------|------------| |-------------------|-----------------------|---------|-----------|------------|
| `background` | animation | | | | | `background` | animation | | | |
| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `comet_main` | animation | | | | | `comet_main` | animation | | | |
| `comet_secondary` | animation | | | | | `comet_secondary` | animation | | | |
| `comet_sparkles` | animation | | | | | `comet_sparkles` | animation | | | |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `space_blue` | color | | | | | `space_blue` | color | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -232,7 +232,7 @@ SUCCESS
| `fire_colors` | palette | | | | | `fire_colors` | palette | | | |
| `fire_pattern` | animation | | | | | `fire_pattern` | animation | | | |
| `palette_gradient_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `palette_gradient_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `strip_len` | value_provider | | | | | `strip_len` | value_provider | | | |
| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ |
@ -367,23 +367,23 @@ SUCCESS
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|----------------------------|---------|-----------|------------| |----------------------|----------------------------|---------|-----------|------------|
| `LINEAR` | constant | ✓ | | | | `LINEAR` | constant | ✓ | | |
| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `disco_base` | animation | | | | | `disco_base` | animation | | | |
| `disco_colors` | palette | | | | | `disco_colors` | palette | | | |
| `disco_pulse` | animation | | | | | `disco_pulse` | animation | | | |
| `disco_rich_color` | color | | | | | `disco_rich_color` | color | | | |
| `disco_sparkles` | animation | | | | | `disco_sparkles` | animation | | | |
| `pulse_pattern` | color | | | | | `pulse_pattern` | color | | | |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `sparkle_pattern` | color | | | | | `sparkle_pattern` | color | | | |
| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `square` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
| `white_flash` | animation | | | | | `white_flash` | animation | | | |
### Compilation Output ### Compilation Output
@ -441,18 +441,18 @@ stack traceback:
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|----------------------------|---------|-----------|------------| |----------------------|----------------------------|---------|-----------|------------|
| `LINEAR` | constant | ✓ | | | | `LINEAR` | constant | ✓ | | |
| `fire_base_color` | color | | | | | `fire_base_color` | color | | | |
| `fire_base` | animation | | | | | `fire_base` | animation | | | |
| `fire_colors` | palette | | | | | `fire_colors` | palette | | | |
| `fire_flicker` | animation | | | | | `fire_flicker` | animation | | | |
| `flicker_pattern` | color | | | | | `flicker_pattern` | color | | | |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -533,10 +533,10 @@ SUCCESS
| `lava_blob3` | animation | | | | | `lava_blob3` | animation | | | |
| `lava_colors` | palette | | | | | `lava_colors` | palette | | | |
| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `shimmer_pattern` | color | | | | | `shimmer_pattern` | color | | | |
| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -563,7 +563,7 @@ SUCCESS
| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `square` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `storm_bg` | animation | | | | | `storm_bg` | animation | | | |
| `storm_colors` | palette | | | | | `storm_colors` | palette | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -577,23 +577,23 @@ SUCCESS
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|-----------------------|---------|-----------|------------| |----------------------|-----------------------|---------|-----------|------------|
| `LINEAR` | constant | ✓ | | | | `LINEAR` | constant | ✓ | | |
| `background` | animation | | | | | `background` | animation | | | |
| `code_flash` | animation | | | | | `code_flash` | animation | | | |
| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `matrix_bg` | color | | | | | `matrix_bg` | color | | | |
| `matrix_greens` | palette | | | | | `matrix_greens` | palette | | | |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `stream1_pattern` | color | | | | | `stream1_pattern` | color | | | |
| `stream1` | animation | | | | | `stream1` | animation | | | |
| `stream2_pattern` | color | | | | | `stream2_pattern` | color | | | |
| `stream2` | animation | | | | | `stream2` | animation | | | |
| `stream3_pattern` | color | | | | | `stream3_pattern` | color | | | |
| `stream3` | animation | | | | | `stream3` | animation | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -607,19 +607,19 @@ SUCCESS
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|-----------------------|---------|-----------|------------| |-------------------|-----------------------|---------|-----------|------------|
| `background` | animation | | | | | `background` | animation | | | |
| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `meteor1` | animation | | | | | `meteor1` | animation | | | |
| `meteor2` | animation | | | | | `meteor2` | animation | | | |
| `meteor3` | animation | | | | | `meteor3` | animation | | | |
| `meteor4` | animation | | | | | `meteor4` | animation | | | |
| `meteor_flash` | animation | | | | | `meteor_flash` | animation | | | |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `space_bg` | color | | | | | `space_bg` | color | | | |
| `stars` | animation | | | | | `stars` | animation | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -642,7 +642,7 @@ SUCCESS
| `neon_main` | animation | | | | | `neon_main` | animation | | | |
| `neon_surge` | animation | | | | | `neon_surge` | animation | | | |
| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `segment1` | animation | | | | | `segment1` | animation | | | |
| `segment2` | animation | | | | | `segment2` | animation | | | |
| `segment3` | animation | | | | | `segment3` | animation | | | |
@ -650,7 +650,7 @@ SUCCESS
| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `square` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -672,9 +672,9 @@ SUCCESS
| `ocean_base` | animation | | | | | `ocean_base` | animation | | | |
| `ocean_colors` | palette | | | | | `ocean_colors` | palette | | | |
| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
| `wave1_pattern` | color | | | | | `wave1_pattern` | color | | | |
| `wave1` | animation | | | | | `wave1` | animation | | | |
| `wave2_pattern` | color | | | | | `wave2_pattern` | color | | | |
@ -730,7 +730,7 @@ SUCCESS
| `palette_showcase` | sequence | | | | | `palette_showcase` | sequence | | | |
| `purple` | color | ✓ | | | | `purple` | color | ✓ | | |
| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `sunset_glow` | animation | | | | | `sunset_glow` | animation | | | |
| `sunset_sky` | palette | | | | | `sunset_sky` | palette | | | |
@ -759,7 +759,7 @@ SUCCESS
| `plasma_wave2` | animation | | | | | `plasma_wave2` | animation | | | |
| `plasma_wave3` | animation | | | | | `plasma_wave3` | animation | | | |
| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ |
| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `rich_palette_color` | color_constructor | ✓ | ⚠️ | ✓ |
| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ |
| `wave1_pattern` | color | | | | | `wave1_pattern` | color | | | |
| `wave2_pattern` | color | | | | | `wave2_pattern` | color | | | |
@ -941,7 +941,7 @@ SUCCESS
| `stars` | animation | | | | | `stars` | animation | | | |
| `sun_glow` | animation | | | | | `sun_glow` | animation | | | |
| `sun_position` | animation | | | | | `sun_position` | animation | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output
@ -1167,14 +1167,14 @@ SUCCESS
## Symbol Table ## Symbol Table
| Symbol | Type | Builtin | Dangerous | Takes Args | | Symbol | Type | Builtin | Dangerous | Takes Args |
|---------------------|-----------------------|---------|-----------|------------| |----------------|-----------------------|---------|-----------|------------|
| `background` | animation | | | | | `background` | animation | | | |
| `bright_flash` | animation | | | | | `bright_flash` | animation | | | |
| `night_sky` | color | | | | | `night_sky` | color | | | |
| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ |
| `stars` | animation | | | | | `stars` | animation | | | |
| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | | `twinkle` | animation_constructor | ✓ | ⚠️ | ✓ |
### Compilation Output ### Compilation Output

View File

@ -18,7 +18,7 @@ var fire_colors_ = bytes(
"FFFFFF00" # Yellow "FFFFFF00" # Yellow
) )
var strip_len_ = animation.strip_length(engine) var strip_len_ = animation.strip_length(engine)
var fire_color_ = animation.rich_palette(engine) var fire_color_ = animation.rich_palette_color(engine)
fire_color_.colors = fire_colors_ fire_color_.colors = fire_colors_
var background_ = animation.solid(engine) var background_ = animation.solid(engine)
background_.color = 0xFF000088 background_.color = 0xFF000088
@ -58,7 +58,7 @@ palette fire_colors = [
] ]
set strip_len = strip_length() set strip_len = strip_length()
color fire_color = rich_palette(colors=fire_colors) color fire_color = rich_palette_color(colors=fire_colors)
animation background = solid(color=0x000088, priority=20) animation background = solid(color=0x000088, priority=20)
run background run background

View File

@ -23,7 +23,7 @@ var disco_colors_ = bytes(
"FFFF00FF" # Magenta "FFFF00FF" # Magenta
) )
# Fast color cycling base # Fast color cycling base
var disco_rich_color_ = animation.rich_palette(engine) var disco_rich_color_ = animation.rich_palette_color(engine)
disco_rich_color_.colors = disco_colors_ disco_rich_color_.colors = disco_colors_
disco_rich_color_.period = 1000 disco_rich_color_.period = 1000
disco_rich_color_.transition_type = animation.LINEAR disco_rich_color_.transition_type = animation.LINEAR
@ -52,18 +52,18 @@ white_flash_.opacity = (def (engine)
end)(engine) # Quick white flashes end)(engine) # Quick white flashes
white_flash_.priority = 20 white_flash_.priority = 20
# Add colored sparkles # Add colored sparkles
var sparkle_pattern_ = animation.rich_palette(engine) var sparkle_pattern_ = animation.rich_palette_color(engine)
sparkle_pattern_.colors = disco_colors_ sparkle_pattern_.colors = disco_colors_
sparkle_pattern_.period = 500 sparkle_pattern_.period = 500
sparkle_pattern_.transition_type = animation.LINEAR sparkle_pattern_.transition_type = animation.LINEAR
sparkle_pattern_.brightness = 255 sparkle_pattern_.brightness = 255
var disco_sparkles_ = animation.twinkle_animation(engine) var disco_sparkles_ = animation.twinkle(engine)
disco_sparkles_.color = sparkle_pattern_ # color source disco_sparkles_.color = sparkle_pattern_ # color source
disco_sparkles_.density = 12 # density (many sparkles) disco_sparkles_.density = 12 # density (many sparkles)
disco_sparkles_.twinkle_speed = 80 # twinkle speed (very quick) disco_sparkles_.twinkle_speed = 80 # twinkle speed (very quick)
disco_sparkles_.priority = 15 disco_sparkles_.priority = 15
# Add moving pulse for extra effect # Add moving pulse for extra effect
var pulse_pattern_ = animation.rich_palette(engine) var pulse_pattern_ = animation.rich_palette_color(engine)
pulse_pattern_.colors = disco_colors_ pulse_pattern_.colors = disco_colors_
pulse_pattern_.period = 800 pulse_pattern_.period = 800
pulse_pattern_.transition_type = animation.LINEAR pulse_pattern_.transition_type = animation.LINEAR
@ -107,7 +107,7 @@ palette disco_colors = [
] ]
# Fast color cycling base # Fast color cycling base
color disco_rich_color = rich_palette(colors=disco_colors, period=1s, transition_type=LINEAR, brightness=255) color disco_rich_color = rich_palette_color(colors=disco_colors, period=1s, transition_type=LINEAR, brightness=255)
animation disco_base = solid(color=disco_rich_color) animation disco_base = solid(color=disco_rich_color)
# Add strobe effect # Add strobe effect
@ -119,8 +119,8 @@ white_flash.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cyc
white_flash.priority = 20 white_flash.priority = 20
# Add colored sparkles # Add colored sparkles
color sparkle_pattern = rich_palette(colors=disco_colors, period=500ms, transition_type=LINEAR, brightness=255) color sparkle_pattern = rich_palette_color(colors=disco_colors, period=500ms, transition_type=LINEAR, brightness=255)
animation disco_sparkles = twinkle_animation( animation disco_sparkles = twinkle(
color=sparkle_pattern # color source color=sparkle_pattern # color source
density=12 # density (many sparkles) density=12 # density (many sparkles)
twinkle_speed=80ms # twinkle speed (very quick) twinkle_speed=80ms # twinkle speed (very quick)
@ -128,7 +128,7 @@ animation disco_sparkles = twinkle_animation(
disco_sparkles.priority = 15 disco_sparkles.priority = 15
# Add moving pulse for extra effect # Add moving pulse for extra effect
color pulse_pattern = rich_palette(colors=disco_colors, period=800ms, transition_type=LINEAR, brightness=255) color pulse_pattern = rich_palette_color(colors=disco_colors, period=800ms, transition_type=LINEAR, brightness=255)
animation disco_pulse = beacon_animation( animation disco_pulse = beacon_animation(
color=pulse_pattern # color source color=pulse_pattern # color source
pos=4 # initial position pos=4 # initial position

View File

@ -21,7 +21,7 @@ var fire_colors_ = bytes(
"FFFFFF00" # Yellow "FFFFFF00" # Yellow
) )
# Create base fire animation with palette # Create base fire animation with palette
var fire_base_color_ = animation.rich_palette(engine) var fire_base_color_ = animation.rich_palette_color(engine)
fire_base_color_.colors = fire_colors_ fire_base_color_.colors = fire_colors_
fire_base_color_.period = 3000 fire_base_color_.period = 3000
fire_base_color_.transition_type = animation.LINEAR fire_base_color_.transition_type = animation.LINEAR
@ -37,12 +37,12 @@ fire_base_.opacity = (def (engine)
return provider return provider
end)(engine) end)(engine)
# Add subtle position variation for more realism # Add subtle position variation for more realism
var flicker_pattern_ = animation.rich_palette(engine) var flicker_pattern_ = animation.rich_palette_color(engine)
flicker_pattern_.colors = fire_colors_ flicker_pattern_.colors = fire_colors_
flicker_pattern_.period = 2000 flicker_pattern_.period = 2000
flicker_pattern_.transition_type = animation.LINEAR flicker_pattern_.transition_type = animation.LINEAR
flicker_pattern_.brightness = 255 flicker_pattern_.brightness = 255
var fire_flicker_ = animation.twinkle_animation(engine) var fire_flicker_ = animation.twinkle(engine)
fire_flicker_.color = flicker_pattern_ # color source fire_flicker_.color = flicker_pattern_ # color source
fire_flicker_.density = 12 # density (number of flickers) fire_flicker_.density = 12 # density (number of flickers)
fire_flicker_.twinkle_speed = 200 # twinkle speed (flicker duration) fire_flicker_.twinkle_speed = 200 # twinkle speed (flicker duration)
@ -69,15 +69,15 @@ palette fire_colors = [
] ]
# Create base fire animation with palette # Create base fire animation with palette
color fire_base_color = rich_palette(colors=fire_colors, period=3s, transition_type=LINEAR, brightness=255) color fire_base_color = rich_palette_color(colors=fire_colors, period=3s, transition_type=LINEAR, brightness=255)
animation fire_base = solid(color=fire_base_color) animation fire_base = solid(color=fire_base_color)
# Add flickering effect with random intensity changes # Add flickering effect with random intensity changes
fire_base.opacity = smooth(min_value=180, max_value=255, duration=800ms) fire_base.opacity = smooth(min_value=180, max_value=255, duration=800ms)
# Add subtle position variation for more realism # Add subtle position variation for more realism
color flicker_pattern = rich_palette(colors=fire_colors, period=2s, transition_type=LINEAR, brightness=255) color flicker_pattern = rich_palette_color(colors=fire_colors, period=2s, transition_type=LINEAR, brightness=255)
animation fire_flicker = twinkle_animation( animation fire_flicker = twinkle(
color=flicker_pattern # color source color=flicker_pattern # color source
density=12 # density (number of flickers) density=12 # density (number of flickers)
twinkle_speed=200ms # twinkle speed (flicker duration) twinkle_speed=200ms # twinkle speed (flicker duration)

View File

@ -27,7 +27,7 @@ lava_base_.period = 15000
lava_base_.transition_type = animation.SINE lava_base_.transition_type = animation.SINE
lava_base_.brightness = 180 lava_base_.brightness = 180
# Add slow-moving lava blobs # Add slow-moving lava blobs
var blob1_pattern_ = animation.rich_palette(engine) var blob1_pattern_ = animation.rich_palette_color(engine)
blob1_pattern_.colors = lava_colors_ blob1_pattern_.colors = lava_colors_
blob1_pattern_.period = 12000 blob1_pattern_.period = 12000
blob1_pattern_.transition_type = animation.SINE blob1_pattern_.transition_type = animation.SINE
@ -45,7 +45,7 @@ lava_blob1_.pos = (def (engine)
provider.duration = 20000 provider.duration = 20000
return provider return provider
end)(engine) # Very slow movement end)(engine) # Very slow movement
var blob2_pattern_ = animation.rich_palette(engine) var blob2_pattern_ = animation.rich_palette_color(engine)
blob2_pattern_.colors = lava_colors_ blob2_pattern_.colors = lava_colors_
blob2_pattern_.period = 10000 blob2_pattern_.period = 10000
blob2_pattern_.transition_type = animation.SINE blob2_pattern_.transition_type = animation.SINE
@ -63,7 +63,7 @@ lava_blob2_.pos = (def (engine)
provider.duration = 25000 provider.duration = 25000
return provider return provider
end)(engine) # Opposite direction, slower end)(engine) # Opposite direction, slower
var blob3_pattern_ = animation.rich_palette(engine) var blob3_pattern_ = animation.rich_palette_color(engine)
blob3_pattern_.colors = lava_colors_ blob3_pattern_.colors = lava_colors_
blob3_pattern_.period = 8000 blob3_pattern_.period = 8000
blob3_pattern_.transition_type = animation.SINE blob3_pattern_.transition_type = animation.SINE
@ -82,12 +82,12 @@ lava_blob3_.pos = (def (engine)
return provider return provider
end)(engine) # Small movement range end)(engine) # Small movement range
# Add subtle heat shimmer effect # Add subtle heat shimmer effect
var shimmer_pattern_ = animation.rich_palette(engine) var shimmer_pattern_ = animation.rich_palette_color(engine)
shimmer_pattern_.colors = lava_colors_ shimmer_pattern_.colors = lava_colors_
shimmer_pattern_.period = 6000 shimmer_pattern_.period = 6000
shimmer_pattern_.transition_type = animation.SINE shimmer_pattern_.transition_type = animation.SINE
shimmer_pattern_.brightness = 255 shimmer_pattern_.brightness = 255
var heat_shimmer_ = animation.twinkle_animation(engine) var heat_shimmer_ = animation.twinkle(engine)
heat_shimmer_.color = shimmer_pattern_ # color source heat_shimmer_.color = shimmer_pattern_ # color source
heat_shimmer_.density = 6 # density (shimmer points) heat_shimmer_.density = 6 # density (shimmer points)
heat_shimmer_.twinkle_speed = 1500 # twinkle speed (slow shimmer) heat_shimmer_.twinkle_speed = 1500 # twinkle speed (slow shimmer)
@ -120,7 +120,7 @@ palette lava_colors = [
animation lava_base = rich_palette_animation(colors=lava_colors, period=15s, transition_type=SINE, brightness=180) animation lava_base = rich_palette_animation(colors=lava_colors, period=15s, transition_type=SINE, brightness=180)
# Add slow-moving lava blobs # Add slow-moving lava blobs
color blob1_pattern = rich_palette(colors=lava_colors, period=12s, transition_type=SINE, brightness=255) color blob1_pattern = rich_palette_color(colors=lava_colors, period=12s, transition_type=SINE, brightness=255)
animation lava_blob1 = beacon_animation( animation lava_blob1 = beacon_animation(
color=blob1_pattern # color source color=blob1_pattern # color source
pos=9 # initial position pos=9 # initial position
@ -130,7 +130,7 @@ animation lava_blob1 = beacon_animation(
lava_blob1.priority = 10 lava_blob1.priority = 10
lava_blob1.pos = smooth(min_value=9, max_value=51, duration=20s) # Very slow movement lava_blob1.pos = smooth(min_value=9, max_value=51, duration=20s) # Very slow movement
color blob2_pattern = rich_palette(colors=lava_colors, period=10s, transition_type=SINE, brightness=220) color blob2_pattern = rich_palette_color(colors=lava_colors, period=10s, transition_type=SINE, brightness=220)
animation lava_blob2 = beacon_animation( animation lava_blob2 = beacon_animation(
color=blob2_pattern # color source color=blob2_pattern # color source
pos=46 # initial position pos=46 # initial position
@ -140,7 +140,7 @@ animation lava_blob2 = beacon_animation(
lava_blob2.priority = 8 lava_blob2.priority = 8
lava_blob2.pos = smooth(min_value=46, max_value=14, duration=25s) # Opposite direction, slower lava_blob2.pos = smooth(min_value=46, max_value=14, duration=25s) # Opposite direction, slower
color blob3_pattern = rich_palette(colors=lava_colors, period=8s, transition_type=SINE, brightness=200) color blob3_pattern = rich_palette_color(colors=lava_colors, period=8s, transition_type=SINE, brightness=200)
animation lava_blob3 = beacon_animation( animation lava_blob3 = beacon_animation(
color=blob3_pattern # color source color=blob3_pattern # color source
pos=25 # initial position pos=25 # initial position
@ -151,8 +151,8 @@ lava_blob3.priority = 6
lava_blob3.pos = smooth(min_value=25, max_value=35, duration=18s) # Small movement range lava_blob3.pos = smooth(min_value=25, max_value=35, duration=18s) # Small movement range
# Add subtle heat shimmer effect # Add subtle heat shimmer effect
color shimmer_pattern = rich_palette(colors=lava_colors, period=6s, transition_type=SINE, brightness=255) color shimmer_pattern = rich_palette_color(colors=lava_colors, period=6s, transition_type=SINE, brightness=255)
animation heat_shimmer = twinkle_animation( animation heat_shimmer = twinkle(
color=shimmer_pattern # color source color=shimmer_pattern # color source
density=6 # density (shimmer points) density=6 # density (shimmer points)
twinkle_speed=1.5s # twinkle speed (slow shimmer) twinkle_speed=1.5s # twinkle speed (slow shimmer)

View File

@ -65,7 +65,7 @@ afterglow_.opacity = (def (engine)
end)(engine) # Longer, dimmer glow end)(engine) # Longer, dimmer glow
afterglow_.priority = 10 afterglow_.priority = 10
# Distant thunder (dim flashes) # Distant thunder (dim flashes)
var distant_flash_ = animation.twinkle_animation(engine) var distant_flash_ = animation.twinkle(engine)
distant_flash_.color = 0xFF666699 # Dim blue-white distant_flash_.color = 0xFF666699 # Dim blue-white
distant_flash_.density = 4 # density (few flashes) distant_flash_.density = 4 # density (few flashes)
distant_flash_.twinkle_speed = 300 # twinkle speed (medium duration) distant_flash_.twinkle_speed = 300 # twinkle speed (medium duration)
@ -115,7 +115,7 @@ afterglow.opacity = square(min_value=0, max_value=80, duration=200ms, duty_cycle
afterglow.priority = 10 afterglow.priority = 10
# Distant thunder (dim flashes) # Distant thunder (dim flashes)
animation distant_flash = twinkle_animation( animation distant_flash = twinkle(
color=0x666699 # Dim blue-white color=0x666699 # Dim blue-white
density=4 # density (few flashes) density=4 # density (few flashes)
twinkle_speed=300ms # twinkle speed (medium duration) twinkle_speed=300ms # twinkle speed (medium duration)

View File

@ -26,7 +26,7 @@ var matrix_greens_ = bytes(
"FF00FF00" # Neon green "FF00FF00" # Neon green
) )
# Create multiple cascading streams # Create multiple cascading streams
var stream1_pattern_ = animation.rich_palette(engine) var stream1_pattern_ = animation.rich_palette_color(engine)
stream1_pattern_.colors = matrix_greens_ stream1_pattern_.colors = matrix_greens_
stream1_pattern_.period = 2000 stream1_pattern_.period = 2000
stream1_pattern_.transition_type = animation.LINEAR stream1_pattern_.transition_type = animation.LINEAR
@ -36,7 +36,7 @@ stream1_.color = stream1_pattern_ # color source
stream1_.tail_length = 15 # long tail stream1_.tail_length = 15 # long tail
stream1_.speed = 1500 # speed stream1_.speed = 1500 # speed
stream1_.priority = 10 stream1_.priority = 10
var stream2_pattern_ = animation.rich_palette(engine) var stream2_pattern_ = animation.rich_palette_color(engine)
stream2_pattern_.colors = matrix_greens_ stream2_pattern_.colors = matrix_greens_
stream2_pattern_.period = 1800 stream2_pattern_.period = 1800
stream2_pattern_.transition_type = animation.LINEAR stream2_pattern_.transition_type = animation.LINEAR
@ -46,7 +46,7 @@ stream2_.color = stream2_pattern_ # color source
stream2_.tail_length = 12 # medium tail stream2_.tail_length = 12 # medium tail
stream2_.speed = 2200 # different speed stream2_.speed = 2200 # different speed
stream2_.priority = 8 stream2_.priority = 8
var stream3_pattern_ = animation.rich_palette(engine) var stream3_pattern_ = animation.rich_palette_color(engine)
stream3_pattern_.colors = matrix_greens_ stream3_pattern_.colors = matrix_greens_
stream3_pattern_.period = 2500 stream3_pattern_.period = 2500
stream3_pattern_.transition_type = animation.LINEAR stream3_pattern_.transition_type = animation.LINEAR
@ -57,7 +57,7 @@ stream3_.tail_length = 10 # shorter tail
stream3_.speed = 1800 # another speed stream3_.speed = 1800 # another speed
stream3_.priority = 6 stream3_.priority = 6
# Add random bright flashes (like code highlights) # Add random bright flashes (like code highlights)
var code_flash_ = animation.twinkle_animation(engine) var code_flash_ = animation.twinkle(engine)
code_flash_.color = 0xFF00FFAA # Bright cyan-green code_flash_.color = 0xFF00FFAA # Bright cyan-green
code_flash_.density = 3 # density (few flashes) code_flash_.density = 3 # density (few flashes)
code_flash_.twinkle_speed = 150 # twinkle speed (quick flash) code_flash_.twinkle_speed = 150 # twinkle speed (quick flash)
@ -91,7 +91,7 @@ palette matrix_greens = [
] ]
# Create multiple cascading streams # Create multiple cascading streams
color stream1_pattern = rich_palette(colors=matrix_greens, period=2s, transition_type=LINEAR, brightness=255) color stream1_pattern = rich_palette_color(colors=matrix_greens, period=2s, transition_type=LINEAR, brightness=255)
animation stream1 = comet_animation( animation stream1 = comet_animation(
color=stream1_pattern # color source color=stream1_pattern # color source
tail_length=15 # long tail tail_length=15 # long tail
@ -100,7 +100,7 @@ animation stream1 = comet_animation(
) )
color stream2_pattern = rich_palette(colors=matrix_greens, period=1.8s, transition_type=LINEAR, brightness=200) color stream2_pattern = rich_palette_color(colors=matrix_greens, period=1.8s, transition_type=LINEAR, brightness=200)
animation stream2 = comet_animation( animation stream2 = comet_animation(
color=stream2_pattern # color source color=stream2_pattern # color source
tail_length=12 # medium tail tail_length=12 # medium tail
@ -108,7 +108,7 @@ animation stream2 = comet_animation(
priority = 8 priority = 8
) )
color stream3_pattern = rich_palette(colors=matrix_greens, period=2.5s, transition_type=LINEAR, brightness=180) color stream3_pattern = rich_palette_color(colors=matrix_greens, period=2.5s, transition_type=LINEAR, brightness=180)
animation stream3 = comet_animation( animation stream3 = comet_animation(
color=stream3_pattern # color source color=stream3_pattern # color source
tail_length=10 # shorter tail tail_length=10 # shorter tail
@ -117,7 +117,7 @@ animation stream3 = comet_animation(
) )
# Add random bright flashes (like code highlights) # Add random bright flashes (like code highlights)
animation code_flash = twinkle_animation( animation code_flash = twinkle(
color=0x00FFAA # Bright cyan-green color=0x00FFAA # Bright cyan-green
density=3 # density (few flashes) density=3 # density (few flashes)
twinkle_speed=150ms # twinkle speed (quick flash) twinkle_speed=150ms # twinkle speed (quick flash)

View File

@ -38,13 +38,13 @@ meteor4_.tail_length = 14 # long trail
meteor4_.speed = 2500 # slower speed meteor4_.speed = 2500 # slower speed
meteor4_.priority = 8 meteor4_.priority = 8
# Add distant stars # Add distant stars
var stars_ = animation.twinkle_animation(engine) var stars_ = animation.twinkle(engine)
stars_.color = 0xFFCCCCCC # Dim white stars_.color = 0xFFCCCCCC # Dim white
stars_.density = 12 # density (many stars) stars_.density = 12 # density (many stars)
stars_.twinkle_speed = 2000 # twinkle speed (slow twinkle) stars_.twinkle_speed = 2000 # twinkle speed (slow twinkle)
stars_.priority = 5 stars_.priority = 5
# Add occasional bright flash (meteor explosion) # Add occasional bright flash (meteor explosion)
var meteor_flash_ = animation.twinkle_animation(engine) var meteor_flash_ = animation.twinkle(engine)
meteor_flash_.color = 0xFFFFFFFF # Bright white meteor_flash_.color = 0xFFFFFFFF # Bright white
meteor_flash_.density = 1 # density (single flash) meteor_flash_.density = 1 # density (single flash)
meteor_flash_.twinkle_speed = 100 # twinkle speed (very quick) meteor_flash_.twinkle_speed = 100 # twinkle speed (very quick)
@ -100,7 +100,7 @@ animation meteor4 = comet_animation(
meteor4.priority = 8 meteor4.priority = 8
# Add distant stars # Add distant stars
animation stars = twinkle_animation( animation stars = twinkle(
color=0xCCCCCC # Dim white color=0xCCCCCC # Dim white
density=12 # density (many stars) density=12 # density (many stars)
twinkle_speed=2s # twinkle speed (slow twinkle) twinkle_speed=2s # twinkle speed (slow twinkle)
@ -108,7 +108,7 @@ animation stars = twinkle_animation(
stars.priority = 5 stars.priority = 5
# Add occasional bright flash (meteor explosion) # Add occasional bright flash (meteor explosion)
animation meteor_flash = twinkle_animation( animation meteor_flash = twinkle(
color=0xFFFFFF # Bright white color=0xFFFFFF # Bright white
density=1 # density (single flash) density=1 # density (single flash)
twinkle_speed=100ms # twinkle speed (very quick) twinkle_speed=100ms # twinkle speed (very quick)

View File

@ -47,7 +47,7 @@ neon_surge_.opacity = (def (engine)
end)(engine) # Quick bright surges end)(engine) # Quick bright surges
neon_surge_.priority = 20 neon_surge_.priority = 20
# Add neon tube segments with gaps # Add neon tube segments with gaps
var segment_pattern_ = animation.rich_palette(engine) var segment_pattern_ = animation.rich_palette_color(engine)
segment_pattern_.colors = neon_colors_ segment_pattern_.colors = neon_colors_
segment_pattern_.period = 4000 segment_pattern_.period = 4000
segment_pattern_.transition_type = animation.LINEAR segment_pattern_.transition_type = animation.LINEAR
@ -71,7 +71,7 @@ segment3_.beacon_size = 12 # segment length
segment3_.slew_size = 1 # sharp edges segment3_.slew_size = 1 # sharp edges
segment3_.priority = 10 segment3_.priority = 10
# Add electrical arcing between segments # Add electrical arcing between segments
var arc_sparkles_ = animation.twinkle_animation(engine) var arc_sparkles_ = animation.twinkle(engine)
arc_sparkles_.color = 0xFFAAAAFF # Electric blue arc_sparkles_.color = 0xFFAAAAFF # Electric blue
arc_sparkles_.density = 4 # density (few arcs) arc_sparkles_.density = 4 # density (few arcs)
arc_sparkles_.twinkle_speed = 100 # twinkle speed (quick arcs) arc_sparkles_.twinkle_speed = 100 # twinkle speed (quick arcs)
@ -112,7 +112,7 @@ neon_surge.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cycl
neon_surge.priority = 20 neon_surge.priority = 20
# Add neon tube segments with gaps # Add neon tube segments with gaps
color segment_pattern = rich_palette(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255) color segment_pattern = rich_palette_color(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255)
animation segment1 = beacon_animation( animation segment1 = beacon_animation(
color=segment_pattern # color source color=segment_pattern # color source
pos=6 # position pos=6 # position
@ -138,7 +138,7 @@ animation segment3 = beacon_animation(
segment3.priority = 10 segment3.priority = 10
# Add electrical arcing between segments # Add electrical arcing between segments
animation arc_sparkles = twinkle_animation( animation arc_sparkles = twinkle(
color=0xAAAAFF # Electric blue color=0xAAAAFF # Electric blue
density=4 # density (few arcs) density=4 # density (few arcs)
twinkle_speed=100ms # twinkle speed (quick arcs) twinkle_speed=100ms # twinkle speed (quick arcs)

View File

@ -27,7 +27,7 @@ ocean_base_.period = 8000
ocean_base_.transition_type = animation.SINE ocean_base_.transition_type = animation.SINE
ocean_base_.brightness = 200 ocean_base_.brightness = 200
# Add wave motion with moving pulses # Add wave motion with moving pulses
var wave1_pattern_ = animation.rich_palette(engine) var wave1_pattern_ = animation.rich_palette_color(engine)
wave1_pattern_.colors = ocean_colors_ wave1_pattern_.colors = ocean_colors_
wave1_pattern_.period = 6000 wave1_pattern_.period = 6000
wave1_pattern_.transition_type = animation.SINE wave1_pattern_.transition_type = animation.SINE
@ -45,7 +45,7 @@ wave1_.pos = (def (engine)
provider.duration = 5000 provider.duration = 5000
return provider return provider
end)(engine) # 60-12 = 48 end)(engine) # 60-12 = 48
var wave2_pattern_ = animation.rich_palette(engine) var wave2_pattern_ = animation.rich_palette_color(engine)
wave2_pattern_.colors = ocean_colors_ wave2_pattern_.colors = ocean_colors_
wave2_pattern_.period = 4000 wave2_pattern_.period = 4000
wave2_pattern_.transition_type = animation.SINE wave2_pattern_.transition_type = animation.SINE
@ -64,7 +64,7 @@ wave2_.pos = (def (engine)
return provider return provider
end)(engine) # Opposite direction end)(engine) # Opposite direction
# Add foam sparkles # Add foam sparkles
var foam_ = animation.twinkle_animation(engine) var foam_ = animation.twinkle(engine)
foam_.color = 0xFFFFFFFF # White foam foam_.color = 0xFFFFFFFF # White foam
foam_.density = 6 # density (sparkle count) foam_.density = 6 # density (sparkle count)
foam_.twinkle_speed = 300 # twinkle speed (quick sparkles) foam_.twinkle_speed = 300 # twinkle speed (quick sparkles)
@ -96,7 +96,7 @@ palette ocean_colors = [
animation ocean_base = rich_palette_animation(colors=ocean_colors, period=8s, transition_type=SINE, brightness=200) animation ocean_base = rich_palette_animation(colors=ocean_colors, period=8s, transition_type=SINE, brightness=200)
# Add wave motion with moving pulses # Add wave motion with moving pulses
color wave1_pattern = rich_palette(colors=ocean_colors, period=6s, transition_type=SINE, brightness=255) color wave1_pattern = rich_palette_color(colors=ocean_colors, period=6s, transition_type=SINE, brightness=255)
animation wave1 = beacon_animation( animation wave1 = beacon_animation(
color=wave1_pattern # color source color=wave1_pattern # color source
pos=0 # initial position pos=0 # initial position
@ -106,7 +106,7 @@ animation wave1 = beacon_animation(
wave1.priority = 10 wave1.priority = 10
wave1.pos = sawtooth(min_value=0, max_value=48, duration=5s) # 60-12 = 48 wave1.pos = sawtooth(min_value=0, max_value=48, duration=5s) # 60-12 = 48
color wave2_pattern = rich_palette(colors=ocean_colors, period=4s, transition_type=SINE, brightness=180) color wave2_pattern = rich_palette_color(colors=ocean_colors, period=4s, transition_type=SINE, brightness=180)
animation wave2 = beacon_animation( animation wave2 = beacon_animation(
color=wave2_pattern # color source color=wave2_pattern # color source
pos=52 # initial position pos=52 # initial position
@ -117,7 +117,7 @@ wave2.priority = 8
wave2.pos = sawtooth(min_value=52, max_value=8, duration=7s) # Opposite direction wave2.pos = sawtooth(min_value=52, max_value=8, duration=7s) # Opposite direction
# Add foam sparkles # Add foam sparkles
animation foam = twinkle_animation( animation foam = twinkle(
color=0xFFFFFF # White foam color=0xFFFFFF # White foam
density=6 # density (sparkle count) density=6 # density (sparkle count)
twinkle_speed=300ms # twinkle speed (quick sparkles) twinkle_speed=300ms # twinkle speed (quick sparkles)

View File

@ -51,7 +51,7 @@ var sunset_sky_ = bytes(
# Create animations using each palette # Create animations using each palette
var fire_effect_ = animation.solid(engine) var fire_effect_ = animation.solid(engine)
fire_effect_.color = (def (engine) fire_effect_.color = (def (engine)
var provider = animation.rich_palette(engine) var provider = animation.rich_palette_color(engine)
provider.colors = fire_gradient_ provider.colors = fire_gradient_
provider.period = 3000 provider.period = 3000
return provider return provider
@ -143,7 +143,7 @@ palette sunset_sky = [
] ]
# Create animations using each palette # Create animations using each palette
animation fire_effect = solid(color=rich_palette(colors=fire_gradient, period=3s)) animation fire_effect = solid(color=rich_palette_color(colors=fire_gradient, period=3s))
animation ocean_waves = rich_palette_animation(colors=ocean_depths, period=8s, transition_type=SINE, brightness=200) animation ocean_waves = rich_palette_animation(colors=ocean_depths, period=8s, transition_type=SINE, brightness=200)

View File

@ -28,7 +28,7 @@ plasma_base_.period = 6000
plasma_base_.transition_type = animation.SINE plasma_base_.transition_type = animation.SINE
plasma_base_.brightness = 200 plasma_base_.brightness = 200
# Add multiple wave layers for complexity # Add multiple wave layers for complexity
var wave1_pattern_ = animation.rich_palette(engine) var wave1_pattern_ = animation.rich_palette_color(engine)
wave1_pattern_.colors = plasma_colors_ wave1_pattern_.colors = plasma_colors_
wave1_pattern_.period = 4000 wave1_pattern_.period = 4000
wave1_pattern_.transition_type = animation.SINE wave1_pattern_.transition_type = animation.SINE
@ -46,7 +46,7 @@ plasma_wave1_.pos = (def (engine)
provider.duration = 8000 provider.duration = 8000
return provider return provider
end)(engine) end)(engine)
var wave2_pattern_ = animation.rich_palette(engine) var wave2_pattern_ = animation.rich_palette_color(engine)
wave2_pattern_.colors = plasma_colors_ wave2_pattern_.colors = plasma_colors_
wave2_pattern_.period = 5000 wave2_pattern_.period = 5000
wave2_pattern_.transition_type = animation.SINE wave2_pattern_.transition_type = animation.SINE
@ -64,7 +64,7 @@ plasma_wave2_.pos = (def (engine)
provider.duration = 10000 provider.duration = 10000
return provider return provider
end)(engine) # Opposite direction end)(engine) # Opposite direction
var wave3_pattern_ = animation.rich_palette(engine) var wave3_pattern_ = animation.rich_palette_color(engine)
wave3_pattern_.colors = plasma_colors_ wave3_pattern_.colors = plasma_colors_
wave3_pattern_.period = 3000 wave3_pattern_.period = 3000
wave3_pattern_.transition_type = animation.SINE wave3_pattern_.transition_type = animation.SINE
@ -118,7 +118,7 @@ palette plasma_colors = [
animation plasma_base = rich_palette_animation(colors=plasma_colors, period=6s, transition_type=SINE, brightness=200) animation plasma_base = rich_palette_animation(colors=plasma_colors, period=6s, transition_type=SINE, brightness=200)
# Add multiple wave layers for complexity # Add multiple wave layers for complexity
color wave1_pattern = rich_palette(colors=plasma_colors, period=4s, transition_type=SINE, brightness=255) color wave1_pattern = rich_palette_color(colors=plasma_colors, period=4s, transition_type=SINE, brightness=255)
animation plasma_wave1 = beacon_animation( animation plasma_wave1 = beacon_animation(
color=wave1_pattern # color source color=wave1_pattern # color source
pos=0 # initial position pos=0 # initial position
@ -128,7 +128,7 @@ animation plasma_wave1 = beacon_animation(
plasma_wave1.priority = 10 plasma_wave1.priority = 10
plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s) plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s)
color wave2_pattern = rich_palette(colors=plasma_colors, period=5s, transition_type=SINE, brightness=180) color wave2_pattern = rich_palette_color(colors=plasma_colors, period=5s, transition_type=SINE, brightness=180)
animation plasma_wave2 = beacon_animation( animation plasma_wave2 = beacon_animation(
color=wave2_pattern # color source color=wave2_pattern # color source
pos=45 # initial position pos=45 # initial position
@ -138,7 +138,7 @@ animation plasma_wave2 = beacon_animation(
plasma_wave2.priority = 8 plasma_wave2.priority = 8
plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction
color wave3_pattern = rich_palette(colors=plasma_colors, period=3s, transition_type=SINE, brightness=220) color wave3_pattern = rich_palette_color(colors=plasma_colors, period=3s, transition_type=SINE, brightness=220)
animation plasma_wave3 = beacon_animation( animation plasma_wave3 = beacon_animation(
color=wave3_pattern # color source color=wave3_pattern # color source
pos=20 # initial position pos=20 # initial position

View File

@ -71,7 +71,7 @@ sun_glow_.opacity = (def (engine)
return provider return provider
end)(engine) # Dimmer glow end)(engine) # Dimmer glow
# Add twinkling stars during night phases # Add twinkling stars during night phases
var stars_ = animation.twinkle_animation(engine) var stars_ = animation.twinkle(engine)
stars_.color = 0xFFFFFFFF # White stars stars_.color = 0xFFFFFFFF # White stars
stars_.density = 6 # density (star count) stars_.density = 6 # density (star count)
stars_.twinkle_speed = 1000 # twinkle speed (slow twinkle) stars_.twinkle_speed = 1000 # twinkle speed (slow twinkle)
@ -136,7 +136,7 @@ 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 sun_glow.opacity = smooth(min_value=0, max_value=150, duration=30s) # Dimmer glow
# Add twinkling stars during night phases # Add twinkling stars during night phases
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFFF # White stars color=0xFFFFFF # White stars
density=6 # density (star count) density=6 # density (star count)
twinkle_speed=1s # twinkle speed (slow twinkle) twinkle_speed=1s # twinkle speed (slow twinkle)

View File

@ -17,13 +17,13 @@ var night_sky_ = 0xFF000033
var background_ = animation.solid(engine) var background_ = animation.solid(engine)
background_.color = night_sky_ background_.color = night_sky_
# White twinkling stars # White twinkling stars
var stars_ = animation.twinkle_animation(engine) var stars_ = animation.twinkle(engine)
stars_.color = 0xFFFFFFFF # White stars stars_.color = 0xFFFFFFFF # White stars
stars_.density = 8 # density (number of stars) stars_.density = 8 # density (number of stars)
stars_.twinkle_speed = 500 # twinkle speed (twinkle duration) stars_.twinkle_speed = 500 # twinkle speed (twinkle duration)
stars_.priority = 10 stars_.priority = 10
# Add occasional bright flash # Add occasional bright flash
var bright_flash_ = animation.twinkle_animation(engine) var bright_flash_ = animation.twinkle(engine)
bright_flash_.color = 0xFFFFFFAA # Bright yellow-white bright_flash_.color = 0xFFFFFFAA # Bright yellow-white
bright_flash_.density = 2 # density (fewer bright flashes) bright_flash_.density = 2 # density (fewer bright flashes)
bright_flash_.twinkle_speed = 300 # twinkle speed (quick flash) bright_flash_.twinkle_speed = 300 # twinkle speed (quick flash)
@ -46,7 +46,7 @@ color night_sky = 0x000033
animation background = solid(color=night_sky) animation background = solid(color=night_sky)
# White twinkling stars # White twinkling stars
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFFF # White stars color=0xFFFFFF # White stars
density=8 # density (number of stars) density=8 # density (number of stars)
twinkle_speed=500ms # twinkle speed (twinkle duration) twinkle_speed=500ms # twinkle speed (twinkle duration)
@ -54,7 +54,7 @@ animation stars = twinkle_animation(
stars.priority = 10 stars.priority = 10
# Add occasional bright flash # Add occasional bright flash
animation bright_flash = twinkle_animation( animation bright_flash = twinkle(
color=0xFFFFAA # Bright yellow-white color=0xFFFFAA # Bright yellow-white
density=2 # density (fewer bright flashes) density=2 # density (fewer bright flashes)
twinkle_speed=300ms # twinkle speed (quick flash) twinkle_speed=300ms # twinkle speed (quick flash)

View File

@ -9,7 +9,7 @@ palette fire_colors = [
] ]
set strip_len = strip_length() set strip_len = strip_length()
color fire_color = rich_palette(colors=fire_colors) color fire_color = rich_palette_color(colors=fire_colors)
animation background = solid(color=0x000088, priority=20) animation background = solid(color=0x000088, priority=20)
run background run background

View File

@ -15,7 +15,7 @@ palette disco_colors = [
] ]
# Fast color cycling base # Fast color cycling base
color disco_rich_color = rich_palette(colors=disco_colors, period=1s, transition_type=LINEAR, brightness=255) color disco_rich_color = rich_palette_color(colors=disco_colors, period=1s, transition_type=LINEAR, brightness=255)
animation disco_base = solid(color=disco_rich_color) animation disco_base = solid(color=disco_rich_color)
# Add strobe effect # Add strobe effect
@ -27,8 +27,8 @@ white_flash.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cyc
white_flash.priority = 20 white_flash.priority = 20
# Add colored sparkles # Add colored sparkles
color sparkle_pattern = rich_palette(colors=disco_colors, period=500ms, transition_type=LINEAR, brightness=255) color sparkle_pattern = rich_palette_color(colors=disco_colors, period=500ms, transition_type=LINEAR, brightness=255)
animation disco_sparkles = twinkle_animation( animation disco_sparkles = twinkle(
color=sparkle_pattern # color source color=sparkle_pattern # color source
density=12 # density (many sparkles) density=12 # density (many sparkles)
twinkle_speed=80ms # twinkle speed (very quick) twinkle_speed=80ms # twinkle speed (very quick)
@ -36,7 +36,7 @@ animation disco_sparkles = twinkle_animation(
disco_sparkles.priority = 15 disco_sparkles.priority = 15
# Add moving pulse for extra effect # Add moving pulse for extra effect
color pulse_pattern = rich_palette(colors=disco_colors, period=800ms, transition_type=LINEAR, brightness=255) color pulse_pattern = rich_palette_color(colors=disco_colors, period=800ms, transition_type=LINEAR, brightness=255)
animation disco_pulse = beacon_animation( animation disco_pulse = beacon_animation(
color=pulse_pattern # color source color=pulse_pattern # color source
pos=4 # initial position pos=4 # initial position

View File

@ -13,15 +13,15 @@ palette fire_colors = [
] ]
# Create base fire animation with palette # Create base fire animation with palette
color fire_base_color = rich_palette(colors=fire_colors, period=3s, transition_type=LINEAR, brightness=255) color fire_base_color = rich_palette_color(colors=fire_colors, period=3s, transition_type=LINEAR, brightness=255)
animation fire_base = solid(color=fire_base_color) animation fire_base = solid(color=fire_base_color)
# Add flickering effect with random intensity changes # Add flickering effect with random intensity changes
fire_base.opacity = smooth(min_value=180, max_value=255, duration=800ms) fire_base.opacity = smooth(min_value=180, max_value=255, duration=800ms)
# Add subtle position variation for more realism # Add subtle position variation for more realism
color flicker_pattern = rich_palette(colors=fire_colors, period=2s, transition_type=LINEAR, brightness=255) color flicker_pattern = rich_palette_color(colors=fire_colors, period=2s, transition_type=LINEAR, brightness=255)
animation fire_flicker = twinkle_animation( animation fire_flicker = twinkle(
color=flicker_pattern # color source color=flicker_pattern # color source
density=12 # density (number of flickers) density=12 # density (number of flickers)
twinkle_speed=200ms # twinkle speed (flicker duration) twinkle_speed=200ms # twinkle speed (flicker duration)

View File

@ -16,7 +16,7 @@ palette lava_colors = [
animation lava_base = rich_palette_animation(colors=lava_colors, period=15s, transition_type=SINE, brightness=180) animation lava_base = rich_palette_animation(colors=lava_colors, period=15s, transition_type=SINE, brightness=180)
# Add slow-moving lava blobs # Add slow-moving lava blobs
color blob1_pattern = rich_palette(colors=lava_colors, period=12s, transition_type=SINE, brightness=255) color blob1_pattern = rich_palette_color(colors=lava_colors, period=12s, transition_type=SINE, brightness=255)
animation lava_blob1 = beacon_animation( animation lava_blob1 = beacon_animation(
color=blob1_pattern # color source color=blob1_pattern # color source
pos=9 # initial position pos=9 # initial position
@ -26,7 +26,7 @@ animation lava_blob1 = beacon_animation(
lava_blob1.priority = 10 lava_blob1.priority = 10
lava_blob1.pos = smooth(min_value=9, max_value=51, duration=20s) # Very slow movement lava_blob1.pos = smooth(min_value=9, max_value=51, duration=20s) # Very slow movement
color blob2_pattern = rich_palette(colors=lava_colors, period=10s, transition_type=SINE, brightness=220) color blob2_pattern = rich_palette_color(colors=lava_colors, period=10s, transition_type=SINE, brightness=220)
animation lava_blob2 = beacon_animation( animation lava_blob2 = beacon_animation(
color=blob2_pattern # color source color=blob2_pattern # color source
pos=46 # initial position pos=46 # initial position
@ -36,7 +36,7 @@ animation lava_blob2 = beacon_animation(
lava_blob2.priority = 8 lava_blob2.priority = 8
lava_blob2.pos = smooth(min_value=46, max_value=14, duration=25s) # Opposite direction, slower lava_blob2.pos = smooth(min_value=46, max_value=14, duration=25s) # Opposite direction, slower
color blob3_pattern = rich_palette(colors=lava_colors, period=8s, transition_type=SINE, brightness=200) color blob3_pattern = rich_palette_color(colors=lava_colors, period=8s, transition_type=SINE, brightness=200)
animation lava_blob3 = beacon_animation( animation lava_blob3 = beacon_animation(
color=blob3_pattern # color source color=blob3_pattern # color source
pos=25 # initial position pos=25 # initial position
@ -47,8 +47,8 @@ lava_blob3.priority = 6
lava_blob3.pos = smooth(min_value=25, max_value=35, duration=18s) # Small movement range lava_blob3.pos = smooth(min_value=25, max_value=35, duration=18s) # Small movement range
# Add subtle heat shimmer effect # Add subtle heat shimmer effect
color shimmer_pattern = rich_palette(colors=lava_colors, period=6s, transition_type=SINE, brightness=255) color shimmer_pattern = rich_palette_color(colors=lava_colors, period=6s, transition_type=SINE, brightness=255)
animation heat_shimmer = twinkle_animation( animation heat_shimmer = twinkle(
color=shimmer_pattern # color source color=shimmer_pattern # color source
density=6 # density (shimmer points) density=6 # density (shimmer points)
twinkle_speed=1.5s # twinkle speed (slow shimmer) twinkle_speed=1.5s # twinkle speed (slow shimmer)

View File

@ -33,7 +33,7 @@ afterglow.opacity = square(min_value=0, max_value=80, duration=200ms, duty_cycle
afterglow.priority = 10 afterglow.priority = 10
# Distant thunder (dim flashes) # Distant thunder (dim flashes)
animation distant_flash = twinkle_animation( animation distant_flash = twinkle(
color=0x666699 # Dim blue-white color=0x666699 # Dim blue-white
density=4 # density (few flashes) density=4 # density (few flashes)
twinkle_speed=300ms # twinkle speed (medium duration) twinkle_speed=300ms # twinkle speed (medium duration)

View File

@ -17,7 +17,7 @@ palette matrix_greens = [
] ]
# Create multiple cascading streams # Create multiple cascading streams
color stream1_pattern = rich_palette(colors=matrix_greens, period=2s, transition_type=LINEAR, brightness=255) color stream1_pattern = rich_palette_color(colors=matrix_greens, period=2s, transition_type=LINEAR, brightness=255)
animation stream1 = comet_animation( animation stream1 = comet_animation(
color=stream1_pattern # color source color=stream1_pattern # color source
tail_length=15 # long tail tail_length=15 # long tail
@ -26,7 +26,7 @@ animation stream1 = comet_animation(
) )
color stream2_pattern = rich_palette(colors=matrix_greens, period=1.8s, transition_type=LINEAR, brightness=200) color stream2_pattern = rich_palette_color(colors=matrix_greens, period=1.8s, transition_type=LINEAR, brightness=200)
animation stream2 = comet_animation( animation stream2 = comet_animation(
color=stream2_pattern # color source color=stream2_pattern # color source
tail_length=12 # medium tail tail_length=12 # medium tail
@ -34,7 +34,7 @@ animation stream2 = comet_animation(
priority = 8 priority = 8
) )
color stream3_pattern = rich_palette(colors=matrix_greens, period=2.5s, transition_type=LINEAR, brightness=180) color stream3_pattern = rich_palette_color(colors=matrix_greens, period=2.5s, transition_type=LINEAR, brightness=180)
animation stream3 = comet_animation( animation stream3 = comet_animation(
color=stream3_pattern # color source color=stream3_pattern # color source
tail_length=10 # shorter tail tail_length=10 # shorter tail
@ -43,7 +43,7 @@ animation stream3 = comet_animation(
) )
# Add random bright flashes (like code highlights) # Add random bright flashes (like code highlights)
animation code_flash = twinkle_animation( animation code_flash = twinkle(
color=0x00FFAA # Bright cyan-green color=0x00FFAA # Bright cyan-green
density=3 # density (few flashes) density=3 # density (few flashes)
twinkle_speed=150ms # twinkle speed (quick flash) twinkle_speed=150ms # twinkle speed (quick flash)

View File

@ -37,7 +37,7 @@ animation meteor4 = comet_animation(
meteor4.priority = 8 meteor4.priority = 8
# Add distant stars # Add distant stars
animation stars = twinkle_animation( animation stars = twinkle(
color=0xCCCCCC # Dim white color=0xCCCCCC # Dim white
density=12 # density (many stars) density=12 # density (many stars)
twinkle_speed=2s # twinkle speed (slow twinkle) twinkle_speed=2s # twinkle speed (slow twinkle)
@ -45,7 +45,7 @@ animation stars = twinkle_animation(
stars.priority = 5 stars.priority = 5
# Add occasional bright flash (meteor explosion) # Add occasional bright flash (meteor explosion)
animation meteor_flash = twinkle_animation( animation meteor_flash = twinkle(
color=0xFFFFFF # Bright white color=0xFFFFFF # Bright white
density=1 # density (single flash) density=1 # density (single flash)
twinkle_speed=100ms # twinkle speed (very quick) twinkle_speed=100ms # twinkle speed (very quick)

View File

@ -23,7 +23,7 @@ neon_surge.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cycl
neon_surge.priority = 20 neon_surge.priority = 20
# Add neon tube segments with gaps # Add neon tube segments with gaps
color segment_pattern = rich_palette(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255) color segment_pattern = rich_palette_color(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255)
animation segment1 = beacon_animation( animation segment1 = beacon_animation(
color=segment_pattern # color source color=segment_pattern # color source
pos=6 # position pos=6 # position
@ -49,7 +49,7 @@ animation segment3 = beacon_animation(
segment3.priority = 10 segment3.priority = 10
# Add electrical arcing between segments # Add electrical arcing between segments
animation arc_sparkles = twinkle_animation( animation arc_sparkles = twinkle(
color=0xAAAAFF # Electric blue color=0xAAAAFF # Electric blue
density=4 # density (few arcs) density=4 # density (few arcs)
twinkle_speed=100ms # twinkle speed (quick arcs) twinkle_speed=100ms # twinkle speed (quick arcs)

View File

@ -16,7 +16,7 @@ palette ocean_colors = [
animation ocean_base = rich_palette_animation(colors=ocean_colors, period=8s, transition_type=SINE, brightness=200) animation ocean_base = rich_palette_animation(colors=ocean_colors, period=8s, transition_type=SINE, brightness=200)
# Add wave motion with moving pulses # Add wave motion with moving pulses
color wave1_pattern = rich_palette(colors=ocean_colors, period=6s, transition_type=SINE, brightness=255) color wave1_pattern = rich_palette_color(colors=ocean_colors, period=6s, transition_type=SINE, brightness=255)
animation wave1 = beacon_animation( animation wave1 = beacon_animation(
color=wave1_pattern # color source color=wave1_pattern # color source
pos=0 # initial position pos=0 # initial position
@ -26,7 +26,7 @@ animation wave1 = beacon_animation(
wave1.priority = 10 wave1.priority = 10
wave1.pos = sawtooth(min_value=0, max_value=48, duration=5s) # 60-12 = 48 wave1.pos = sawtooth(min_value=0, max_value=48, duration=5s) # 60-12 = 48
color wave2_pattern = rich_palette(colors=ocean_colors, period=4s, transition_type=SINE, brightness=180) color wave2_pattern = rich_palette_color(colors=ocean_colors, period=4s, transition_type=SINE, brightness=180)
animation wave2 = beacon_animation( animation wave2 = beacon_animation(
color=wave2_pattern # color source color=wave2_pattern # color source
pos=52 # initial position pos=52 # initial position
@ -37,7 +37,7 @@ wave2.priority = 8
wave2.pos = sawtooth(min_value=52, max_value=8, duration=7s) # Opposite direction wave2.pos = sawtooth(min_value=52, max_value=8, duration=7s) # Opposite direction
# Add foam sparkles # Add foam sparkles
animation foam = twinkle_animation( animation foam = twinkle(
color=0xFFFFFF # White foam color=0xFFFFFF # White foam
density=6 # density (sparkle count) density=6 # density (sparkle count)
twinkle_speed=300ms # twinkle speed (quick sparkles) twinkle_speed=300ms # twinkle speed (quick sparkles)

View File

@ -44,7 +44,7 @@ palette sunset_sky = [
] ]
# Create animations using each palette # Create animations using each palette
animation fire_effect = solid(color=rich_palette(colors=fire_gradient, period=3s)) animation fire_effect = solid(color=rich_palette_color(colors=fire_gradient, period=3s))
animation ocean_waves = rich_palette_animation(colors=ocean_depths, period=8s, transition_type=SINE, brightness=200) animation ocean_waves = rich_palette_animation(colors=ocean_depths, period=8s, transition_type=SINE, brightness=200)

View File

@ -17,7 +17,7 @@ palette plasma_colors = [
animation plasma_base = rich_palette_animation(colors=plasma_colors, period=6s, transition_type=SINE, brightness=200) animation plasma_base = rich_palette_animation(colors=plasma_colors, period=6s, transition_type=SINE, brightness=200)
# Add multiple wave layers for complexity # Add multiple wave layers for complexity
color wave1_pattern = rich_palette(colors=plasma_colors, period=4s, transition_type=SINE, brightness=255) color wave1_pattern = rich_palette_color(colors=plasma_colors, period=4s, transition_type=SINE, brightness=255)
animation plasma_wave1 = beacon_animation( animation plasma_wave1 = beacon_animation(
color=wave1_pattern # color source color=wave1_pattern # color source
pos=0 # initial position pos=0 # initial position
@ -27,7 +27,7 @@ animation plasma_wave1 = beacon_animation(
plasma_wave1.priority = 10 plasma_wave1.priority = 10
plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s) plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s)
color wave2_pattern = rich_palette(colors=plasma_colors, period=5s, transition_type=SINE, brightness=180) color wave2_pattern = rich_palette_color(colors=plasma_colors, period=5s, transition_type=SINE, brightness=180)
animation plasma_wave2 = beacon_animation( animation plasma_wave2 = beacon_animation(
color=wave2_pattern # color source color=wave2_pattern # color source
pos=45 # initial position pos=45 # initial position
@ -37,7 +37,7 @@ animation plasma_wave2 = beacon_animation(
plasma_wave2.priority = 8 plasma_wave2.priority = 8
plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction
color wave3_pattern = rich_palette(colors=plasma_colors, period=3s, transition_type=SINE, brightness=220) color wave3_pattern = rich_palette_color(colors=plasma_colors, period=3s, transition_type=SINE, brightness=220)
animation plasma_wave3 = beacon_animation( animation plasma_wave3 = beacon_animation(
color=wave3_pattern # color source color=wave3_pattern # color source
pos=20 # initial position pos=20 # initial position

View File

@ -42,7 +42,7 @@ 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 sun_glow.opacity = smooth(min_value=0, max_value=150, duration=30s) # Dimmer glow
# Add twinkling stars during night phases # Add twinkling stars during night phases
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFFF # White stars color=0xFFFFFF # White stars
density=6 # density (star count) density=6 # density (star count)
twinkle_speed=1s # twinkle speed (slow twinkle) twinkle_speed=1s # twinkle speed (slow twinkle)

View File

@ -8,7 +8,7 @@ color night_sky = 0x000033
animation background = solid(color=night_sky) animation background = solid(color=night_sky)
# White twinkling stars # White twinkling stars
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFFF # White stars color=0xFFFFFF # White stars
density=8 # density (number of stars) density=8 # density (number of stars)
twinkle_speed=500ms # twinkle speed (twinkle duration) twinkle_speed=500ms # twinkle speed (twinkle duration)
@ -16,7 +16,7 @@ animation stars = twinkle_animation(
stars.priority = 10 stars.priority = 10
# Add occasional bright flash # Add occasional bright flash
animation bright_flash = twinkle_animation( animation bright_flash = twinkle(
color=0xFFFFAA # Bright yellow-white color=0xFFFFAA # Bright yellow-white
density=2 # density (fewer bright flashes) density=2 # density (fewer bright flashes)
twinkle_speed=300ms # twinkle speed (quick flash) twinkle_speed=300ms # twinkle speed (quick flash)

View File

@ -1,4 +1,4 @@
# @desc Twinkle stars - using predefined animations # @desc Twinkle stars - using predefined animations
animation stars = twinkle_animation() animation stars = twinkle()
run stars run stars

View File

@ -1,7 +1,7 @@
# @desc Twinkle stars with parameters - using animation parameters # @desc Twinkle stars with parameters - using animation parameters
# Note: when parameters are in separate lines, you don't need a comma ',' # Note: when parameters are in separate lines, you don't need a comma ','
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFAA # Light yellow sparkles color=0xFFFFAA # Light yellow sparkles
density=8 # density (moderate sparkles) density=8 # density (moderate sparkles)
twinkle_speed=100ms # twinkle speed twinkle_speed=100ms # twinkle speed

View File

@ -6,7 +6,7 @@ animation background = solid(color=space_blue)
run background run background
# Note: when parameters are in separate lines, you don't need a comma ',' # Note: when parameters are in separate lines, you don't need a comma ','
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFAA # Light yellow sparkles color=0xFFFFAA # Light yellow sparkles
density=8 # density (moderate sparkles) density=8 # density (moderate sparkles)
twinkle_speed=100ms # twinkle speed twinkle_speed=100ms # twinkle speed

View File

@ -15,7 +15,7 @@ palette rainbow_with_white = [
] ]
# Define a color attribute that cycles over time, cycle is 10 seconds # Define a color attribute that cycles over time, cycle is 10 seconds
color rainbow_color_rollover = rich_palette(period=10s) color rainbow_color_rollover = rich_palette_color(period=10s)
# Use the dynamic color in a simple 'solid' animation # Use the dynamic color in a simple 'solid' animation
animation back = solid(color=rainbow_color_rollover) animation back = solid(color=rainbow_color_rollover)

View File

@ -2,7 +2,7 @@
# Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white)
# 'period = 0' means that the colors don't change in time, only spatial change # 'period = 0' means that the colors don't change in time, only spatial change
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# Define a gradient across the whole strip # Define a gradient across the whole strip
animation back_pattern = palette_gradient_animation(color_source = rainbow_rich_color) animation back_pattern = palette_gradient_animation(color_source = rainbow_rich_color)

View File

@ -3,7 +3,7 @@
# Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white)
# 'period = 0' means that the colors don't change in time, only spatial change # 'period = 0' means that the colors don't change in time, only spatial change
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas # Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas
set strip_len = strip_length() set strip_len = strip_length()

View File

@ -2,7 +2,7 @@
# Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white)
# 'period = 0' means that the colors don't change in time, only spatial change # 'period = 0' means that the colors don't change in time, only spatial change
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas # Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas
set strip_len = strip_length() set strip_len = strip_length()

View File

@ -2,7 +2,7 @@
# Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white)
# 'period = 0' means that the colors don't change in time, only spatial change # 'period = 0' means that the colors don't change in time, only spatial change
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# define a gradient across the whole strip # define a gradient across the whole strip
animation back = palette_gradient_animation(color_source = rainbow_rich_color, shift_period = 5s) animation back = palette_gradient_animation(color_source = rainbow_rich_color, shift_period = 5s)

View File

@ -13,7 +13,7 @@ palette vue_meter_palette = [
] ]
# Define a color palette pattern for 'vue_meter_palette' # Define a color palette pattern for 'vue_meter_palette'
color rainbow_rich_color = rich_palette(colors=vue_meter_palette, period=0, transition_type=LINEAR) color rainbow_rich_color = rich_palette_color(colors=vue_meter_palette, period=0, transition_type=LINEAR)
# Define a sawtooth value from 0% to 100% # Define a sawtooth value from 0% to 100%
set level = sawtooth(min_value = 0%, max_value=100%, duration = 2s) set level = sawtooth(min_value = 0%, max_value=100%, duration = 2s)

View File

@ -24,7 +24,7 @@ palette vue_meter_palette = [
] ]
# Define a color palette pattern for 'vue_meter_palette' # Define a color palette pattern for 'vue_meter_palette'
color rainbow_rich_color = rich_palette(colors=vue_meter_palette, period=0, transition_type=LINEAR) color rainbow_rich_color = rich_palette_color(colors=vue_meter_palette, period=0, transition_type=LINEAR)
# Define a vue-meter based on all elements above # Define a vue-meter based on all elements above
animation back = palette_meter_animation(color_source = rainbow_rich_color, level = rand_meter()) animation back = palette_meter_animation(color_source = rainbow_rich_color, level = rand_meter())

View File

@ -5,7 +5,7 @@
# Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas # Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas
set strip_len = strip_length() set strip_len = strip_length()
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFAA # Light yellow sparkles color=0xFFFFAA # Light yellow sparkles
density=2 # density (moderate sparkles) density=2 # density (moderate sparkles)
twinkle_speed=100ms # twinkle speed twinkle_speed=100ms # twinkle speed
@ -16,7 +16,7 @@ run stars
# We can combine a dynamic 'pos' value with a dynamic 'color' # We can combine a dynamic 'pos' value with a dynamic 'color'
animation back = beacon_animation( animation back = beacon_animation(
color = rich_palette(colors=PALETTE_RAINBOW_W2, period=5s) color = rich_palette_color(colors=PALETTE_RAINBOW_W2, period=5s)
pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s) pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s)
beacon_size = 3 # small 3 pixels eye beacon_size = 3 # small 3 pixels eye
slew_size = 2 # with 2 pixel shading around slew_size = 2 # with 2 pixel shading around

View File

@ -7,8 +7,8 @@ set strip_len = strip_length()
# Define a pattern that goes from red to blue to red across the strip # Define a pattern that goes from red to blue to red across the strip
palette red_blue_red_palette = [ red, 0x3333FF, red ] palette red_blue_red_palette = [ red, 0x3333FF, red ]
# Embed this raw palette into a rich_palette color provider # Embed this raw palette into a rich_palette_color color provider
color red_blue_red_color = rich_palette(colors=red_blue_red_palette) color red_blue_red_color = rich_palette_color(colors=red_blue_red_palette)
# Define a moving beacon to be used as an opacity mask # Define a moving beacon to be used as an opacity mask
animation moving_eye = beacon_animation( animation moving_eye = beacon_animation(

View File

@ -1,7 +1,7 @@
# @desc Crenel static with variable color # @desc Crenel static with variable color
# Define a color attribute that cycles over time, cycle is 5 seconds # Define a color attribute that cycles over time, cycle is 5 seconds
color rainbow_color = rich_palette(colors=PALETTE_RAINBOW_W2, period=5s) color rainbow_color = rich_palette_color(colors=PALETTE_RAINBOW_W2, period=5s)
# Define a simple crenel 2+2 # Define a simple crenel 2+2
animation back = crenel_animation( animation back = crenel_animation(

View File

@ -13,7 +13,7 @@ animation mask = crenel_animation(
) )
# Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white)
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# Define a gradient across the whole strip and use crenel as opacity mask # Define a gradient across the whole strip and use crenel as opacity mask
animation pattern = palette_gradient_animation( animation pattern = palette_gradient_animation(
color_source = rainbow_rich_color # use the rainow pattern color_source = rainbow_rich_color # use the rainow pattern

View File

@ -29,7 +29,7 @@ ParameterizedObject (base class with parameter management and playable interface
│ │ └── GradientMeterAnimation (VU meter with gradient colors and peak hold) │ │ └── GradientMeterAnimation (VU meter with gradient colors and peak hold)
│ ├── CometAnimation (moving comet with tail) │ ├── CometAnimation (moving comet with tail)
│ ├── FireAnimation (realistic fire effect) │ ├── FireAnimation (realistic fire effect)
│ ├── TwinkleAnimation (twinkling stars effect) │ ├── twinkle (twinkling stars effect)
│ ├── WaveAnimation (wave motion effects) │ ├── WaveAnimation (wave motion effects)
│ └── RichPaletteAnimation (smooth palette transitions) │ └── RichPaletteAnimation (smooth palette transitions)
├── SequenceManager (orchestrates animation sequences) ├── SequenceManager (orchestrates animation sequences)
@ -42,7 +42,7 @@ ParameterizedObject (base class with parameter management and playable interface
└── ColorProvider (dynamic color generation) └── ColorProvider (dynamic color generation)
├── StaticColorProvider (solid color) ├── StaticColorProvider (solid color)
├── ColorCycleColorProvider (cycles through palette) ├── ColorCycleColorProvider (cycles through palette)
├── RichPaletteColorProvider (smooth palette transitions) ├── rich_palette_color (smooth palette transitions)
├── BreatheColorProvider (breathing color effect) ├── BreatheColorProvider (breathing color effect)
└── CompositeColorProvider (blends multiple colors) └── CompositeColorProvider (blends multiple colors)
``` ```
@ -418,7 +418,7 @@ color mixed_cycle = color_cycle(
) )
``` ```
### RichPaletteColorProvider ### rich_palette_color
Generates colors from predefined palettes with smooth transitions and professional color schemes. Inherits from `ColorProvider`. Generates colors from predefined palettes with smooth transitions and professional color schemes. Inherits from `ColorProvider`.
@ -441,7 +441,7 @@ Generates colors from predefined palettes with smooth transitions and profession
```berry ```berry
# Rainbow palette with smooth ease-in/ease-out transitions # Rainbow palette with smooth ease-in/ease-out transitions
color rainbow_colors = rich_palette( color rainbow_colors = rich_palette_color(
colors=PALETTE_RAINBOW, colors=PALETTE_RAINBOW,
period=5s, period=5s,
transition_type=SINE, transition_type=SINE,
@ -449,7 +449,7 @@ color rainbow_colors = rich_palette(
) )
# Fire effect with linear (constant speed) transitions # Fire effect with linear (constant speed) transitions
color fire_colors = rich_palette( color fire_colors = rich_palette_color(
colors=PALETTE_FIRE, colors=PALETTE_FIRE,
period=3s, period=3s,
transition_type=LINEAR, transition_type=LINEAR,
@ -634,13 +634,13 @@ filled gradient area
```berry ```berry
# Simple meter with rainbow gradient # Simple meter with rainbow gradient
color rainbow = rich_palette() color rainbow = rich_palette_color()
animation meter = gradient_meter_animation() animation meter = gradient_meter_animation()
meter.color_source = rainbow meter.color_source = rainbow
meter.level = 128 meter.level = 128
# Meter with peak hold (1 second) # Meter with peak hold (1 second)
color fire_colors = rich_palette(colors=PALETTE_FIRE) color fire_colors = rich_palette_color(colors=PALETTE_FIRE)
animation vu_meter = gradient_meter_animation(peak_hold=1000) animation vu_meter = gradient_meter_animation(peak_hold=1000)
vu_meter.color_source = fire_colors vu_meter.color_source = fire_colors
@ -966,12 +966,12 @@ Creates smooth color transitions using rich palette data with direct parameter a
**Special Features**: **Special Features**:
- Direct parameter access (set `anim.colors` instead of `anim.color.colors`) - Direct parameter access (set `anim.colors` instead of `anim.color.colors`)
- Parameters are automatically forwarded to internal `RichPaletteColorProvider` - Parameters are automatically forwarded to internal `rich_palette_color`
- Access to specialized methods via `anim.color_provider.method_name()` - Access to specialized methods via `anim.color_provider.method_name()`
**Factory**: `animation.rich_palette_animation(engine)` **Factory**: `animation.rich_palette_animation(engine)`
### TwinkleAnimation ### twinkle
Creates a twinkling stars effect with random lights appearing and fading. Inherits from `Animation`. Creates a twinkling stars effect with random lights appearing and fading. Inherits from `Animation`.
@ -985,7 +985,7 @@ Creates a twinkling stars effect with random lights appearing and fading. Inheri
| `max_brightness` | int | 255 | 0-255 | Maximum twinkle brightness | | `max_brightness` | int | 255 | 0-255 | Maximum twinkle brightness |
| *(inherits all Animation parameters)* | | | | | | *(inherits all Animation parameters)* | | | | |
**Factories**: `animation.twinkle_animation(engine)`, `animation.twinkle_classic(engine)`, `animation.twinkle_solid(engine)`, `animation.twinkle_rainbow(engine)`, `animation.twinkle_gentle(engine)`, `animation.twinkle_intense(engine)` **Factories**: `animation.twinkle(engine)`
### WaveAnimation ### WaveAnimation

View File

@ -39,7 +39,7 @@ Before diving into code, let's understand the building blocks:
| Concept | What It Does | Example | | Concept | What It Does | Example |
|---------|--------------|---------| |---------|--------------|---------|
| **Animation** | A visual effect on the LED strip | `solid`, `twinkle_animation`, `beacon_animation` | | **Animation** | A visual effect on the LED strip | `solid`, `twinkle`, `beacon_animation` |
| **Color** | Either a static value or a dynamic provider that changes over time | `red`, `0xFF0000`, `color_cycle(...)` | | **Color** | Either a static value or a dynamic provider that changes over time | `red`, `0xFF0000`, `color_cycle(...)` |
| **Palette** | A collection of colors for gradients or cycling | `PALETTE_RAINBOW`, custom arrays | | **Palette** | A collection of colors for gradients or cycling | `PALETTE_RAINBOW`, custom arrays |
| **Value Provider** | A number that changes over time (oscillates) | `sine_osc`, `triangle`, `sawtooth` | | **Value Provider** | A number that changes over time (oscillates) | `sine_osc`, `triangle`, `sawtooth` |
@ -112,12 +112,12 @@ The DSL also provides `transparent` as a predefined color, equivalent to `0x0000
<a href="https://tasmota.github.io/docs/Tasmota-Berry-emulator/index.html?example=chap_1_30_twinkle" target="_blank"><img src="../../_media/berry_animation/chap_1_30.png" alt="Twinkle Stars"></a> <a href="https://tasmota.github.io/docs/Tasmota-Berry-emulator/index.html?example=chap_1_30_twinkle" target="_blank"><img src="../../_media/berry_animation/chap_1_30.png" alt="Twinkle Stars"></a>
Beyond `solid`, the DSL includes many ready-to-use animation types. Each creates a different visual effect. Let's try `twinkle_animation`, which creates a twinkling stars effect. Beyond `solid`, the DSL includes many ready-to-use animation types. Each creates a different visual effect. Let's try `twinkle`, which creates a twinkling stars effect.
```berry ```berry
# Twinkle stars - using predefined animations # Twinkle stars - using predefined animations
animation stars = twinkle_animation() animation stars = twinkle()
run stars run stars
``` ```
@ -133,7 +133,7 @@ Most animations accept **parameters** to customize their behavior. Parameters us
# Twinkle stars with parameters - using animation parameters # Twinkle stars with parameters - using animation parameters
# Note: when parameters are in separate lines, you don't need a comma ',' # Note: when parameters are in separate lines, you don't need a comma ','
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFAA # Light yellow sparkles color=0xFFFFAA # Light yellow sparkles
density=8 # density (moderate sparkles) density=8 # density (moderate sparkles)
twinkle_speed=100ms # twinkle speed twinkle_speed=100ms # twinkle speed
@ -166,7 +166,7 @@ animation background = solid(color=space_blue)
run background run background
# Twinkle stars on top # Twinkle stars on top
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFAA # Light yellow sparkles color=0xFFFFAA # Light yellow sparkles
density=8 # density (moderate sparkles) density=8 # density (moderate sparkles)
twinkle_speed=100ms # twinkle speed twinkle_speed=100ms # twinkle speed
@ -259,7 +259,7 @@ The `palette` keyword creates a named color collection. Colors are listed in ord
## Chapter 3: Smooth Color Transitions ## Chapter 3: Smooth Color Transitions
Chapter 2 showed `color_cycle`, which steps discretely between colors. This chapter introduces `rich_palette`, which creates **smooth, interpolated transitions** - the color gradually morphs from one to the next. Chapter 2 showed `color_cycle`, which steps discretely between colors. This chapter introduces `rich_palette_color`, which creates **smooth, interpolated transitions** - the color gradually morphs from one to the next.
### 3.1 Rich Palette Animation ### 3.1 Rich Palette Animation
@ -283,7 +283,7 @@ With no parameters, it uses sensible defaults. The `transition_type=SINE` create
<a href="https://tasmota.github.io/docs/Tasmota-Berry-emulator/index.html?example=chap_3_20_color_transition_palette" target="_blank"><img src="../../_media/berry_animation/chap_3_20.png" alt="Rich Palette Custom"></a> <a href="https://tasmota.github.io/docs/Tasmota-Berry-emulator/index.html?example=chap_3_20_color_transition_palette" target="_blank"><img src="../../_media/berry_animation/chap_3_20.png" alt="Rich Palette Custom"></a>
For more control, use `rich_palette` as a **color provider** (not an animation). This lets you use smooth color transitions with any animation type. For more control, use `rich_palette_color` as a **color provider** (not an animation). This lets you use smooth color transitions with any animation type.
```berry ```berry
# Smooth cycling through rainbow colors with custom palette # Smooth cycling through rainbow colors with custom palette
@ -301,7 +301,7 @@ palette rainbow_with_white = [
] ]
# Define a color that cycles over time with smooth transitions # Define a color that cycles over time with smooth transitions
color rainbow_color_rollover = rich_palette(period=10s) color rainbow_color_rollover = rich_palette_color(period=10s)
# Use the dynamic color in a solid animation # Use the dynamic color in a solid animation
animation back = solid(color=rainbow_color_rollover) animation back = solid(color=rainbow_color_rollover)
@ -333,7 +333,7 @@ A gradient maps colors to positions along the strip. The `palette_gradient_anima
# Rainbow pattern across the strip # Rainbow pattern across the strip
# Define a palette with period=0 (no time-based change, only spatial) # Define a palette with period=0 (no time-based change, only spatial)
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# Create a gradient across the whole strip # Create a gradient across the whole strip
animation back_pattern = palette_gradient_animation(color_source = rainbow_rich_color) animation back_pattern = palette_gradient_animation(color_source = rainbow_rich_color)
@ -351,7 +351,7 @@ By default, the gradient spans the entire strip once. Use `spatial_period` to co
```berry ```berry
# Rainbow gradient with 2 repetitions across the strip # Rainbow gradient with 2 repetitions across the strip
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
# Get the strip length as a variable # Get the strip length as a variable
set strip_len = strip_length() set strip_len = strip_length()
@ -378,7 +378,7 @@ Here's where things get interesting: you can make **any parameter dynamic** by u
```berry ```berry
# Rainbow gradient with oscillating spatial period # Rainbow gradient with oscillating spatial period
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
set strip_len = strip_length() set strip_len = strip_length()
@ -411,7 +411,7 @@ Make the gradient rotate along the strip:
```berry ```berry
# Rainbow gradient rotating along the strip over 5 seconds # Rainbow gradient rotating along the strip over 5 seconds
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
animation back = palette_gradient_animation( animation back = palette_gradient_animation(
color_source = rainbow_rich_color color_source = rainbow_rich_color
@ -443,7 +443,7 @@ palette vue_meter_palette = [
(255, 0xFF0000) # Red at 100% (255, 0xFF0000) # Red at 100%
] ]
color rainbow_rich_color = rich_palette(colors=vue_meter_palette, period=0, transition_type=LINEAR) color rainbow_rich_color = rich_palette_color(colors=vue_meter_palette, period=0, transition_type=LINEAR)
# Sawtooth value from 0% to 100% # Sawtooth value from 0% to 100%
set level = sawtooth(min_value = 0%, max_value=100%, duration = 2s) set level = sawtooth(min_value = 0%, max_value=100%, duration = 2s)
@ -495,7 +495,7 @@ palette vue_meter_palette = [
(255, 0xFF0000) (255, 0xFF0000)
] ]
color rainbow_rich_color = rich_palette(colors=vue_meter_palette, period=0, transition_type=LINEAR) color rainbow_rich_color = rich_palette_color(colors=vue_meter_palette, period=0, transition_type=LINEAR)
# Step 3: Use the custom function as a parameter # Step 3: Use the custom function as a parameter
# Call it with () - the engine parameter is passed automatically # Call it with () - the engine parameter is passed automatically
@ -636,7 +636,7 @@ Let's combine everything we've learned: layered animations, dynamic colors, and
set strip_len = strip_length() set strip_len = strip_length()
# Twinkling stars background # Twinkling stars background
animation stars = twinkle_animation( animation stars = twinkle(
color=0xFFFFAA color=0xFFFFAA
density=2 density=2
twinkle_speed=100ms twinkle_speed=100ms
@ -648,7 +648,7 @@ run stars
# Moving beacon with dynamic color # Moving beacon with dynamic color
# back_color defaults to transparent, so stars show through # back_color defaults to transparent, so stars show through
animation back = beacon_animation( animation back = beacon_animation(
color = rich_palette(colors=PALETTE_RAINBOW_W2, period=5s) color = rich_palette_color(colors=PALETTE_RAINBOW_W2, period=5s)
pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s) pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s)
beacon_size = 3 beacon_size = 3
slew_size = 2 slew_size = 2
@ -686,7 +686,7 @@ set strip_len = strip_length()
# Define a red-blue-red gradient palette # Define a red-blue-red gradient palette
palette red_blue_red_palette = [ red, 0x3333FF, red ] palette red_blue_red_palette = [ red, 0x3333FF, red ]
color red_blue_red_color = rich_palette(colors=red_blue_red_palette) color red_blue_red_color = rich_palette_color(colors=red_blue_red_palette)
# Moving beacon as opacity mask # Moving beacon as opacity mask
# The color is white but it doesn't matter - only brightness counts # The color is white but it doesn't matter - only brightness counts
@ -1022,12 +1022,12 @@ run back
<a href="https://tasmota.github.io/docs/Tasmota-Berry-emulator/index.html?example=chap_7_40_crenel_color" target="_blank"><img src="../../_media/berry_animation/chap_7_40.png" alt="Dynamic Colors"></a> <a href="https://tasmota.github.io/docs/Tasmota-Berry-emulator/index.html?example=chap_7_40_crenel_color" target="_blank"><img src="../../_media/berry_animation/chap_7_40.png" alt="Dynamic Colors"></a>
The `color` parameter also accepts a color provider instead of a static color. This example uses `rich_palette` to cycle through rainbow colors over 5 seconds, making the crenel pulses continuously change color while the blue background remains fixed: The `color` parameter also accepts a color provider instead of a static color. This example uses `rich_palette_color` to cycle through rainbow colors over 5 seconds, making the crenel pulses continuously change color while the blue background remains fixed:
```berry ```berry
# Crenel with dynamic color # Crenel with dynamic color
color rainbow_color = rich_palette(colors=PALETTE_RAINBOW_W2, period=5s) color rainbow_color = rich_palette_color(colors=PALETTE_RAINBOW_W2, period=5s)
animation back = crenel_animation( animation back = crenel_animation(
color = rainbow_color color = rainbow_color
@ -1074,7 +1074,7 @@ animation mask = crenel_animation(
) )
# Rainbow gradient masked by crenel # Rainbow gradient masked by crenel
color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) color rainbow_rich_color = rich_palette_color(colors=PALETTE_RAINBOW_W, period=0)
animation pattern = palette_gradient_animation( animation pattern = palette_gradient_animation(
color_source = rainbow_rich_color color_source = rainbow_rich_color
shift_period = 2s # Rotating gradient shift_period = 2s # Rotating gradient
@ -1279,7 +1279,7 @@ run main
| Animation | Description | Key Parameters | | Animation | Description | Key Parameters |
|-----------|-------------|----------------| |-----------|-------------|----------------|
| `solid` | Solid color fill | `color` | | `solid` | Solid color fill | `color` |
| `twinkle_animation` | Twinkling stars effect | `color`, `density`, `twinkle_speed`, `fade_speed` | | `twinkle` | Twinkling stars effect | `color`, `density`, `twinkle_speed`, `fade_speed` |
| `beacon_animation` | Positioned pulse/highlight | `color`, `pos`, `beacon_size`, `slew_size` | | `beacon_animation` | Positioned pulse/highlight | `color`, `pos`, `beacon_size`, `slew_size` |
| `crenel_animation` | Square wave pattern | `color`, `back_color`, `pulse_size`, `low_size` | | `crenel_animation` | Square wave pattern | `color`, `back_color`, `pulse_size`, `low_size` |
| `rich_palette_animation` | Smooth palette cycling | `colors`, `period`, `transition_type` | | `rich_palette_animation` | Smooth palette cycling | `colors`, `period`, `transition_type` |

View File

@ -484,7 +484,7 @@ animation.register_user_function("custom_palette", create_custom_palette)
```berry ```berry
# Use in DSL # Use in DSL
animation dynamic_anim = rich_palette( animation dynamic_anim = rich_palette_color(
colors=custom_palette(0xFF0000, 200) colors=custom_palette(0xFF0000, 200)
period=3s period=3s
) )
@ -1421,7 +1421,7 @@ Color providers create dynamic colors that change over time:
|----------|-------------| |----------|-------------|
| `static_color` | Solid color with optional dynamic opacity | | `static_color` | Solid color with optional dynamic opacity |
| `color_cycle` | Cycles through a palette of colors | | `color_cycle` | Cycles through a palette of colors |
| `rich_palette` | Advanced palette-based color cycling with smooth transitions | | `rich_palette_color` | Advanced palette-based color cycling with smooth transitions |
| `composite_color` | Combines multiple color providers | | `composite_color` | Combines multiple color providers |
| `breathe_color` | Breathing/pulsing color effect with brightness modulation | | `breathe_color` | Breathing/pulsing color effect with brightness modulation |
| `pulsating_color` | Fast pulsing color effect (alias for breathe_color with curve_factor=1) | | `pulsating_color` | Fast pulsing color effect (alias for breathe_color with curve_factor=1) |
@ -1439,7 +1439,7 @@ Animation classes create visual effects on LED strips:
| `breathe_animation` | Breathing/fading effect | | `breathe_animation` | Breathing/fading effect |
| `comet_animation` | Moving comet with trailing tail | | `comet_animation` | Moving comet with trailing tail |
| `fire_animation` | Realistic fire simulation | | `fire_animation` | Realistic fire simulation |
| `twinkle_animation` | Twinkling stars effect | | `twinkle` | Twinkling stars effect |
| `gradient_animation` | Color gradient effects | | `gradient_animation` | Color gradient effects |
| `wave_animation` | Wave propagation effects | | `wave_animation` | Wave propagation effects |
| `rich_palette_animation` | Palette-based color cycling | | `rich_palette_animation` | Palette-based color cycling |

View File

@ -155,7 +155,7 @@ animation solid_red = solid(color=custom_color)
**Built-in Symbols** (resolved to `animation.<symbol>`): **Built-in Symbols** (resolved to `animation.<symbol>`):
- Animation factory functions: `solid`, `pulsating_animation`, `comet_animation` - Animation factory functions: `solid`, `pulsating_animation`, `comet_animation`
- Value providers: `triangle`, `smooth`, `sine`, `static_value` - Value providers: `triangle`, `smooth`, `sine`, `static_value`
- Color providers: `color_cycle`, `breathe_color`, `rich_palette` - Color providers: `color_cycle`, `breathe_color`, `rich_palette_color`
- Constants: `PALETTE_RAINBOW`, `SINE`, `TRIANGLE`, etc. - Constants: `PALETTE_RAINBOW`, `SINE`, `TRIANGLE`, etc.
**User-defined Symbols** (resolved to `<symbol>_`): **User-defined Symbols** (resolved to `<symbol>_`):
@ -423,7 +423,7 @@ Register custom Berry functions for use in DSL. User functions must take `engine
```berry ```berry
# Define custom function in Berry - engine must be first parameter # Define custom function in Berry - engine must be first parameter
def custom_twinkle(engine, color, count, period) def custom_twinkle(engine, color, count, period)
var anim = animation.twinkle_animation(engine) var anim = animation.twinkle(engine)
anim.color = color anim.color = color
anim.count = count anim.count = count
atml:parameter> atml:parameter>

View File

@ -338,7 +338,7 @@ base_layer.opacity = breathing
# Accent layer - twinkling stars # Accent layer - twinkling stars
color star_white = 0xFFFFFF color star_white = 0xFFFFFF
animation stars = twinkle_animation(color=star_white, count=5, period=800ms) animation stars = twinkle(color=star_white, count=5, period=800ms)
stars.opacity = 150 stars.opacity = 150
sequence layered_effect { sequence layered_effect {

View File

@ -28,7 +28,7 @@ Create smooth color transitions:
```berry ```berry
# Use predefined rainbow palette # Use predefined rainbow palette
animation rainbow_cycle = rich_palette( animation rainbow_cycle = rich_palette_color(
colors=PALETTE_RAINBOW colors=PALETTE_RAINBOW
period=5s period=5s
transition_type=1 transition_type=1
@ -52,7 +52,7 @@ palette sunset = [
] ]
# Create palette animation # Create palette animation
animation sunset_glow = rich_palette( animation sunset_glow = rich_palette_color(
colors=sunset colors=sunset
period=8s period=8s
transition_type=1 transition_type=1
@ -124,7 +124,7 @@ animation comet = comet_animation(
) )
# Twinkling effect # Twinkling effect
animation sparkles = twinkle_animation( animation sparkles = twinkle(
color=white color=white
count=8 count=8
period=800ms period=800ms
@ -137,7 +137,7 @@ run breathing
### Fire Effect ### Fire Effect
```berry ```berry
animation fire = rich_palette( animation fire = rich_palette_color(
colors=PALETTE_FIRE colors=PALETTE_FIRE
period=2s period=2s
transition_type=1 transition_type=1
@ -226,7 +226,7 @@ For complex logic, create custom functions in Berry:
```berry ```berry
# Define custom function - engine must be first parameter # Define custom function - engine must be first parameter
def my_twinkle(engine, color, count, period) def my_twinkle(engine, color, count, period)
var anim = animation.twinkle_animation(engine) var anim = animation.twinkle(engine)
anim.color = color anim.color = color
anim.count = count anim.count = count
anim.period = period anim.period = period

View File

@ -163,7 +163,7 @@ dim_blue.opacity = bright(30)
```berry ```berry
def custom_fire(engine, intensity, speed) def custom_fire(engine, intensity, speed)
var color_provider = animation.rich_palette(engine) var color_provider = animation.rich_palette_color(engine)
color_provider.colors = animation.PALETTE_FIRE color_provider.colors = animation.PALETTE_FIRE
color_provider.period = speed color_provider.period = speed
@ -188,7 +188,7 @@ torch.opacity = fire(255, 500)
```berry ```berry
def twinkles(engine, color, count, period) def twinkles(engine, color, count, period)
var anim = animation.twinkle_animation(engine) var anim = animation.twinkle(engine)
anim.color = color anim.color = color
anim.count = count anim.count = count
anim.period = period anim.period = period
@ -236,7 +236,7 @@ right_pulse.position = pulse_at(25, 3, 2000)
```berry ```berry
def rainbow_twinkle(engine, base_speed, twinkle_density) def rainbow_twinkle(engine, base_speed, twinkle_density)
# Create base rainbow animation # Create base rainbow animation
var rainbow_provider = animation.rich_palette(engine) var rainbow_provider = animation.rich_palette_color(engine)
rainbow_provider.colors = animation.PALETTE_RAINBOW rainbow_provider.colors = animation.PALETTE_RAINBOW
rainbow_provider.period = base_speed rainbow_provider.period = base_speed
@ -290,7 +290,7 @@ animation.register_user_function("custom_palette", create_custom_palette)
```berry ```berry
# Use dynamic colors in DSL # Use dynamic colors in DSL
animation gradient_effect = rich_palette( animation gradient_effect = rich_palette_color(
colors=custom_palette(0xFF6B35, 5, 255) colors=custom_palette(0xFF6B35, 5, 255)
period=4s period=4s
) )

View File

@ -139,8 +139,8 @@ import "animations/comet" as comet_animation
register_to_animation(comet_animation) register_to_animation(comet_animation)
import "animations/fire" as fire_animation import "animations/fire" as fire_animation
register_to_animation(fire_animation) register_to_animation(fire_animation)
import "animations/twinkle" as twinkle_animation import "animations/twinkle" as twinkle
register_to_animation(twinkle_animation) register_to_animation(twinkle)
import "animations/gradient" as gradient_animation import "animations/gradient" as gradient_animation
register_to_animation(gradient_animation) register_to_animation(gradient_animation)
import "animations/palette_meter" as palette_meter_animation import "animations/palette_meter" as palette_meter_animation

View File

@ -182,7 +182,7 @@ class FireAnimation : animation.animation
# If color is nil, create default fire palette # If color is nil, create default fire palette
if resolved_color == nil if resolved_color == nil
# Create default fire palette on demand # Create default fire palette on demand
var fire_provider = animation.rich_palette(self.engine) var fire_provider = animation.rich_palette_color(self.engine)
fire_provider.colors = animation.PALETTE_FIRE fire_provider.colors = animation.PALETTE_FIRE
fire_provider.period = 0 # Use value-based color mapping, not time-based fire_provider.period = 0 # Use value-based color mapping, not time-based
fire_provider.transition_type = 1 # Use sine transition (smooth) fire_provider.transition_type = 1 # Use sine transition (smooth)

View File

@ -5,7 +5,7 @@
#@ solidify:animation_palettes,weak #@ solidify:animation_palettes,weak
# Define common palette constants (in VRGB format: Value, Red, Green, Blue) # Define common palette constants (in VRGB format: Value, Red, Green, Blue)
# These palettes are compatible with the RichPaletteColorProvider # These palettes are compatible with the rich_palette_color
# Standard rainbow palette (7 colors with roughly constant brightness) # Standard rainbow palette (7 colors with roughly constant brightness)
var PALETTE_RAINBOW = bytes( var PALETTE_RAINBOW = bytes(

View File

@ -1,7 +1,7 @@
# RichPaletteAnimation - Animation with integrated rich palette color provider # RichPaletteAnimation - Animation with integrated rich palette color provider
# #
# This animation class provides direct access to rich palette parameters, # This animation class provides direct access to rich palette parameters,
# forwarding them to an internal RichPaletteColorProvider instance. # forwarding them to an internal rich_palette_colornce.
# This creates a cleaner API where users can set palette parameters directly # This creates a cleaner API where users can set palette parameters directly
# on the animation instead of accessing nested color provider properties. # on the animation instead of accessing nested color provider properties.
# #
@ -12,11 +12,11 @@ import "./core/param_encoder" as encode_constraints
#@ solidify:RichPaletteAnimation,weak #@ solidify:RichPaletteAnimation,weak
class RichPaletteAnimation : animation.animation class RichPaletteAnimation : animation.animation
# Non-parameter instance variables only # Non-parameter instance variables only
var color_provider # Internal RichPaletteColorProvider instance var color_provider # Internal rich_palette_color instance
# Parameter definitions - only RichPaletteColorProvider parameters (Animation params inherited) # Parameter definitions - only rich_palette_color parameters (Animation params inherited)
static var PARAMS = animation.enc_params({ static var PARAMS = animation.enc_params({
# RichPaletteColorProvider parameters (forwarded to internal provider) # rich_palette_color parameters (forwarded to internal provider)
"colors": {"type": "instance", "default": nil}, "colors": {"type": "instance", "default": nil},
"period": {"min": 0, "default": 5000}, "period": {"min": 0, "default": 5000},
"transition_type": {"enum": [1 #-LINEAR-#, 5 #-SINE-#], "default": 5 #-SINE-#}, "transition_type": {"enum": [1 #-LINEAR-#, 5 #-SINE-#], "default": 5 #-SINE-#},
@ -29,8 +29,8 @@ class RichPaletteAnimation : animation.animation
def init(engine) def init(engine)
super(self).init(engine) # Initialize Animation base class super(self).init(engine) # Initialize Animation base class
# Create internal RichPaletteColorProvider instance # Create internal rich_palette_color instance
self.color_provider = animation.rich_palette(engine) self.color_provider = animation.rich_palette_color(engine)
# Set the color parameter to our internal provider # Set the color parameter to our internal provider
# Use direct values assignment to avoid triggering on_param_changed # Use direct values assignment to avoid triggering on_param_changed

View File

@ -5,8 +5,8 @@
import "./core/param_encoder" as encode_constraints import "./core/param_encoder" as encode_constraints
#@ solidify:TwinkleAnimation,weak #@ solidify:twinkle,weak
class TwinkleAnimation : animation.animation class twinkle : animation.animation
# NO instance variables for parameters - they are handled by the virtual parameter system # NO instance variables for parameters - they are handled by the virtual parameter system
# Non-parameter instance variables only # Non-parameter instance variables only
@ -207,97 +207,6 @@ class TwinkleAnimation : animation.animation
return modified return modified
end end
# NO setter/getter methods - use direct assignment instead:
# obj.color = value
# obj.density = value
# obj.twinkle_speed = value
# obj.fade_speed = value
# obj.min_brightness = value
# obj.max_brightness = value
end end
# Factory function to create a classic white twinkle animation return { 'twinkle': twinkle }
#
# @param engine: AnimationEngine - The animation engine
# @return TwinkleAnimation - A new twinkle animation instance
def twinkle_classic(engine)
var anim = animation.twinkle_animation(engine)
anim.color = 0xFFFFFFFF
anim.density = 150
anim.twinkle_speed = 6
anim.fade_speed = 180
anim.min_brightness = 32
anim.max_brightness = 255
return anim
end
# Factory function to create a colored twinkle animation
#
# @param engine: AnimationEngine - The animation engine
# @return TwinkleAnimation - A new twinkle animation instance
def twinkle_solid(engine)
var anim = animation.twinkle_animation(engine)
anim.color = 0xFF0080FF # Blue
anim.density = 100
anim.twinkle_speed = 6
anim.fade_speed = 180
anim.min_brightness = 32
anim.max_brightness = 255
return anim
end
# Factory function to create a rainbow twinkle animation
#
# @param engine: AnimationEngine - The animation engine
# @return TwinkleAnimation - A new twinkle animation instance
def twinkle_rainbow(engine)
var anim = animation.twinkle_animation(engine)
# TODO: Set up rainbow color provider when available
anim.color = 0xFFFFFFFF # White for now
anim.density = 120
anim.twinkle_speed = 6
anim.fade_speed = 180
anim.min_brightness = 32
anim.max_brightness = 255
return anim
end
# Factory function to create a gentle twinkle animation (low density, slow fade)
#
# @param engine: AnimationEngine - The animation engine
# @return TwinkleAnimation - A new twinkle animation instance
def twinkle_gentle(engine)
var anim = animation.twinkle_animation(engine)
anim.color = 0xFFFFD700 # Gold
anim.density = 64
anim.twinkle_speed = 3
anim.fade_speed = 120
anim.min_brightness = 16
anim.max_brightness = 180
return anim
end
# Factory function to create an intense twinkle animation (high density, fast fade)
#
# @param engine: AnimationEngine - The animation engine
# @return TwinkleAnimation - A new twinkle animation instance
def twinkle_intense(engine)
var anim = animation.twinkle_animation(engine)
anim.color = 0xFFFF0000 # Red
anim.density = 200
anim.twinkle_speed = 12
anim.fade_speed = 220
anim.min_brightness = 64
anim.max_brightness = 255
return anim
end
return {
'twinkle_animation': TwinkleAnimation,
'twinkle_classic': twinkle_classic,
'twinkle_solid': twinkle_solid,
'twinkle_rainbow': twinkle_rainbow,
'twinkle_gentle': twinkle_gentle,
'twinkle_intense': twinkle_intense
}

View File

@ -215,7 +215,7 @@ end
def wave_rainbow_sine(engine) def wave_rainbow_sine(engine)
var anim = animation.wave_animation(engine) var anim = animation.wave_animation(engine)
# Set up rainbow color provider # Set up rainbow color provider
var rainbow_provider = animation.rich_palette(engine) var rainbow_provider = animation.rich_palette_color(engine)
rainbow_provider.colors = animation.PALETTE_RAINBOW rainbow_provider.colors = animation.PALETTE_RAINBOW
rainbow_provider.period = 5000 rainbow_provider.period = 5000
rainbow_provider.transition_type = 1 # sine transition rainbow_provider.transition_type = 1 # sine transition

View File

@ -69,7 +69,7 @@ class PlasmaAnimation : animation.animation
# Initialize default color if not set # Initialize default color if not set
if self.color == nil if self.color == nil
var rainbow_provider = animation.rich_palette(self.engine) var rainbow_provider = animation.rich_palette_color(self.engine)
rainbow_provider.colors = animation.PALETTE_RAINBOW rainbow_provider.colors = animation.PALETTE_RAINBOW
rainbow_provider.period = 5000 rainbow_provider.period = 5000
rainbow_provider.transition_type = 1 rainbow_provider.transition_type = 1
@ -88,7 +88,7 @@ class PlasmaAnimation : animation.animation
super(self).on_param_changed(name, value) super(self).on_param_changed(name, value)
if name == "color" && value == nil if name == "color" && value == nil
# Reset to default rainbow palette when color is set to nil # Reset to default rainbow palette when color is set to nil
var rainbow_provider = animation.rich_palette(self.engine) var rainbow_provider = animation.rich_palette_color(self.engine)
rainbow_provider.colors = animation.PALETTE_RAINBOW rainbow_provider.colors = animation.PALETTE_RAINBOW
rainbow_provider.period = 5000 rainbow_provider.period = 5000
rainbow_provider.transition_type = 1 rainbow_provider.transition_type = 1

View File

@ -222,7 +222,7 @@ end
# @param engine: AnimationEngine - Required animation engine reference # @param engine: AnimationEngine - Required animation engine reference
# @return SparkleAnimation - A new rainbow sparkle animation instance # @return SparkleAnimation - A new rainbow sparkle animation instance
def sparkle_rainbow(engine) def sparkle_rainbow(engine)
var rainbow_provider = animation.rich_palette(engine) var rainbow_provider = animation.rich_palette_color(engine)
rainbow_provider.colors = animation.PALETTE_RAINBOW rainbow_provider.colors = animation.PALETTE_RAINBOW
rainbow_provider.period = 5000 rainbow_provider.period = 5000
rainbow_provider.transition_type = 1 # sine transition rainbow_provider.transition_type = 1 # sine transition

View File

@ -1,4 +1,4 @@
# RichPaletteColorProvider for Berry Animation Framework # rich_palette_color for Berry Animation Framework
# #
# This color provider generates colors from a palette with smooth transitions. # This color provider generates colors from a palette with smooth transitions.
# Reuses optimizations from Animate_palette class for maximum efficiency. # Reuses optimizations from Animate_palette class for maximum efficiency.
@ -30,8 +30,8 @@
import "./core/param_encoder" as encode_constraints import "./core/param_encoder" as encode_constraints
#@ solidify:RichPaletteColorProvider,weak #@ solidify:rich_palette_color,weak
class RichPaletteColorProvider : animation.color_provider class rich_palette_color : animation.color_provider
# Non-parameter instance variables only # Non-parameter instance variables only
var _slots_arr # Constructed array of timestamp slots, based on period var _slots_arr # Constructed array of timestamp slots, based on period
var _value_arr # Constructed array of value slots (always 0-255 range) var _value_arr # Constructed array of value slots (always 0-255 range)
@ -48,7 +48,7 @@ class RichPaletteColorProvider : animation.color_provider
# brightness parameter inherited from ColorProvider base class # brightness parameter inherited from ColorProvider base class
}) })
# Initialize a new RichPaletteColorProvider # Initialize a new rich_palette_color
# #
# @param engine: AnimationEngine - Reference to the animation engine (required) # @param engine: AnimationEngine - Reference to the animation engine (required)
def init(engine) def init(engine)
@ -518,4 +518,4 @@ class RichPaletteColorProvider : animation.color_provider
end end
end end
return {'rich_palette': RichPaletteColorProvider} return {'rich_palette_color': rich_palette_color}

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ def test_palette_newline_entries()
" (192, 0x00AA00)\n" + " (192, 0x00AA00)\n" +
" (255, 0x00FF00)\n" + " (255, 0x00FF00)\n" +
"]\n" + "]\n" +
"color stream_color = rich_palette(colors=matrix_greens, period=2s)\n" + "color stream_color = rich_palette_color(colors=matrix_greens, period=2s)\n" +
"animation stream = solid(color=stream_color)\n" + "animation stream = solid(color=stream_color)\n" +
"run stream" "run stream"
@ -111,7 +111,7 @@ def test_color_provider_newline_syntax()
var dsl_source = var dsl_source =
"palette test_palette = [(0, 0x000000), (255, 0xFFFFFF)]\n" + "palette test_palette = [(0, 0x000000), (255, 0xFFFFFF)]\n" +
"color dynamic_color = rich_palette(\n" + "color dynamic_color = rich_palette_color(\n" +
" colors=test_palette\n" + " colors=test_palette\n" +
" period=2s\n" + " period=2s\n" +
" transition_type=LINEAR\n" + " transition_type=LINEAR\n" +
@ -123,7 +123,7 @@ def test_color_provider_newline_syntax()
var berry_code = animation_dsl.compile(dsl_source) var berry_code = animation_dsl.compile(dsl_source)
assert(berry_code != nil, "Should compile color provider with newline syntax") assert(berry_code != nil, "Should compile color provider with newline syntax")
assert(string.find(berry_code, "var dynamic_color_ = animation.rich_palette(engine)") >= 0, "Should generate color provider creation") assert(string.find(berry_code, "var dynamic_color_ = animation.rich_palette_color(engine)") >= 0, "Should generate color provider creation")
assert(string.find(berry_code, "dynamic_color_.colors = test_palette_") >= 0, "Should generate palette assignment") assert(string.find(berry_code, "dynamic_color_.colors = test_palette_") >= 0, "Should generate palette assignment")
assert(string.find(berry_code, "dynamic_color_.period = 2000") >= 0, "Should generate period assignment") assert(string.find(berry_code, "dynamic_color_.period = 2000") >= 0, "Should generate period assignment")
@ -172,7 +172,7 @@ def test_complex_example()
" (255, 0x00FF00) # Neon green\n" + " (255, 0x00FF00) # Neon green\n" +
"]\n" + "]\n" +
"\n" + "\n" +
"color stream_pattern = rich_palette(\n" + "color stream_pattern = rich_palette_color(\n" +
" colors=matrix_greens\n" + " colors=matrix_greens\n" +
" period=2s\n" + " period=2s\n" +
" transition_type=LINEAR\n" + " transition_type=LINEAR\n" +
@ -192,7 +192,7 @@ def test_complex_example()
assert(berry_code != nil, "Should compile complex real-world example") assert(berry_code != nil, "Should compile complex real-world example")
assert(string.find(berry_code, "var matrix_greens_ = bytes(") >= 0, "Should generate palette") assert(string.find(berry_code, "var matrix_greens_ = bytes(") >= 0, "Should generate palette")
assert(string.find(berry_code, "var stream_pattern_ = animation.rich_palette(engine)") >= 0, "Should generate color provider") assert(string.find(berry_code, "var stream_pattern_ = animation.rich_palette_color(engine)") >= 0, "Should generate color provider")
assert(string.find(berry_code, "var stream_ = animation.comet_animation(engine)") >= 0, "Should generate animation") assert(string.find(berry_code, "var stream_ = animation.comet_animation(engine)") >= 0, "Should generate animation")
print("✓ Complex example test passed") print("✓ Complex example test passed")

View File

@ -991,7 +991,7 @@ def test_animation_type_checking()
# Test color provider assigned to animation (should fail at transpile time) # Test color provider assigned to animation (should fail at transpile time)
var color_provider_as_animation_dsl = "# strip length 30 # TEMPORARILY DISABLED\n" + var color_provider_as_animation_dsl = "# strip length 30 # TEMPORARILY DISABLED\n" +
"animation invalid_anim = rich_palette(colors=breathe_palette)" "animation invalid_anim = rich_palette_color(colors=breathe_palette)"
try try
var invalid_code = animation_dsl.compile(color_provider_as_animation_dsl) var invalid_code = animation_dsl.compile(color_provider_as_animation_dsl)

View File

@ -81,7 +81,7 @@ assert(result, "Render should return true")
# Test 3: animation.solid with a rich palette provider # Test 3: animation.solid with a rich palette provider
print("Test 3: animation.solid with a rich palette provider") print("Test 3: animation.solid with a rich palette provider")
var rich_provider = animation.rich_palette(mock_engine) var rich_provider = animation.rich_palette_color(mock_engine)
rich_provider.colors = animation.PALETTE_RAINBOW # Use the rainbow palette rich_provider.colors = animation.PALETTE_RAINBOW # Use the rainbow palette
rich_provider.period = 1000 # 1 second cycle period rich_provider.period = 1000 # 1 second cycle period
# Note: transition_type removed - rich palette uses smooth transitions # Note: transition_type removed - rich palette uses smooth transitions
@ -107,7 +107,7 @@ assert(result, "Render should return true")
# Test 4: animation.solid with a composite provider # Test 4: animation.solid with a composite provider
print("Test 4: animation.solid with a composite provider") print("Test 4: animation.solid with a composite provider")
var rich_provider2 = animation.rich_palette(mock_engine) var rich_provider2 = animation.rich_palette_color(mock_engine)
rich_provider2.colors = animation.PALETTE_RAINBOW rich_provider2.colors = animation.PALETTE_RAINBOW
rich_provider2.period = 1000 rich_provider2.period = 1000
# Note: transition_type removed # Note: transition_type removed

View File

@ -110,7 +110,7 @@ fire.color = 0xFFFF0000 # Red
print("Set to solid red color") print("Set to solid red color")
# Set back to fire palette # Set back to fire palette
var fire_palette = animation.rich_palette(engine) var fire_palette = animation.rich_palette_color(engine)
fire_palette.colors = animation.PALETTE_FIRE fire_palette.colors = animation.PALETTE_FIRE
fire_palette.period = 5000 fire_palette.period = 5000
fire_palette.transition_type = 1 # Use sine transition (smooth) fire_palette.transition_type = 1 # Use sine transition (smooth)

View File

@ -88,7 +88,7 @@ def test_gradient_meter_rendering()
var meter = animation.palette_meter_animation(engine) var meter = animation.palette_meter_animation(engine)
# Use a color provider (required for PaletteGradientAnimation) # Use a color provider (required for PaletteGradientAnimation)
var color_source = animation.rich_palette(engine) var color_source = animation.rich_palette_color(engine)
meter.color_source = color_source meter.color_source = color_source
var frame = animation.frame_buffer(10, 1) var frame = animation.frame_buffer(10, 1)
@ -128,7 +128,7 @@ def test_gradient_meter_peak_indicator()
var meter = animation.palette_meter_animation(engine) var meter = animation.palette_meter_animation(engine)
# Use a color provider # Use a color provider
var color_source = animation.rich_palette(engine) var color_source = animation.rich_palette_color(engine)
meter.color_source = color_source meter.color_source = color_source
meter.peak_hold = 2000 meter.peak_hold = 2000

View File

@ -1,4 +1,4 @@
# Test file for animation.solid with RichPaletteColorProvider # Test file for animation.solid with rich_palette_color
# #
# This file contains tests for the animation.solid class with rich palette provider # This file contains tests for the animation.solid class with rich palette provider
# #
@ -43,7 +43,7 @@ class RichPaletteAnimationTest
self.passed = 0 self.passed = 0
self.failed = 0 self.failed = 0
print("Running animation.solid with RichPaletteColorProvider Tests") print("Running animation.solid with rich_palette_color Tests")
self.test_initialization() self.test_initialization()
self.test_update_and_render() self.test_update_and_render()
@ -53,7 +53,7 @@ class RichPaletteAnimationTest
self.test_sine_mode() self.test_sine_mode()
self.test_sine_mode_value_based() self.test_sine_mode_value_based()
print(f"animation.solid with RichPaletteColorProvider Tests: {self.passed} passed, {self.failed} failed") print(f"animation.solid with rich_palette_color Tests: {self.passed} passed, {self.failed} failed")
if self.failed > 0 if self.failed > 0
raise "test_failed" raise "test_failed"
end end
@ -82,7 +82,7 @@ class RichPaletteAnimationTest
def test_initialization() def test_initialization()
# Test default initialization with rich palette provider # Test default initialization with rich palette provider
var provider = animation.rich_palette(mock_engine) var provider = animation.rich_palette_color(mock_engine)
var anim = animation.solid(mock_engine) var anim = animation.solid(mock_engine)
anim.color = provider anim.color = provider
@ -93,7 +93,7 @@ class RichPaletteAnimationTest
# Test with custom parameters using new parameterized class specification # Test with custom parameters using new parameterized class specification
var custom_palette = bytes("00FF0000" "FFFFFF00") var custom_palette = bytes("00FF0000" "FFFFFF00")
var custom_provider = animation.rich_palette(mock_engine) var custom_provider = animation.rich_palette_color(mock_engine)
custom_provider.colors = custom_palette custom_provider.colors = custom_palette
custom_provider.period = 2000 custom_provider.period = 2000
custom_provider.transition_type = animation.SINE custom_provider.transition_type = animation.SINE
@ -115,7 +115,7 @@ class RichPaletteAnimationTest
def test_update_and_render() def test_update_and_render()
# Create animation with red and blue colors # Create animation with red and blue colors
var colors = bytes("00FF0000" "FF0000FF") # Red to Blue in VRGB format var colors = bytes("00FF0000" "FF0000FF") # Red to Blue in VRGB format
var provider = animation.rich_palette(mock_engine) var provider = animation.rich_palette_color(mock_engine)
provider.colors = colors provider.colors = colors
provider.period = 1000 # 1 second cycle provider.period = 1000 # 1 second cycle
provider.transition_type = animation.LINEAR # linear transition provider.transition_type = animation.LINEAR # linear transition
@ -167,7 +167,7 @@ class RichPaletteAnimationTest
def test_palette_properties() def test_palette_properties()
# Test palette properties and value-based color generation # Test palette properties and value-based color generation
var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue
var provider = animation.rich_palette(mock_engine) var provider = animation.rich_palette_color(mock_engine)
provider.colors = colors provider.colors = colors
provider.period = 1000 provider.period = 1000
@ -196,7 +196,7 @@ class RichPaletteAnimationTest
def test_css_gradient() def test_css_gradient()
# Test CSS gradient generation # Test CSS gradient generation
var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue
var provider = animation.rich_palette(mock_engine) var provider = animation.rich_palette_color(mock_engine)
provider.colors = colors provider.colors = colors
provider.period = 1000 provider.period = 1000
@ -216,7 +216,7 @@ class RichPaletteAnimationTest
def test_cycle_period_zero() def test_cycle_period_zero()
# Test the new period = 0 functionality for value-based color mapping # Test the new period = 0 functionality for value-based color mapping
var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue
var provider = animation.rich_palette(mock_engine) var provider = animation.rich_palette_color(mock_engine)
provider.colors = colors provider.colors = colors
provider.period = 0 # Value-based mode provider.period = 0 # Value-based mode
provider.start() provider.start()
@ -267,7 +267,7 @@ class RichPaletteAnimationTest
var colors = bytes("00FF0000" "FF0000FF") # Red at 0, Blue at 255 var colors = bytes("00FF0000" "FF0000FF") # Red at 0, Blue at 255
# Create LINEAR provider # Create LINEAR provider
var provider_linear = animation.rich_palette(mock_engine) var provider_linear = animation.rich_palette_color(mock_engine)
provider_linear.colors = colors provider_linear.colors = colors
provider_linear.period = 1000 provider_linear.period = 1000
provider_linear.transition_type = animation.LINEAR provider_linear.transition_type = animation.LINEAR
@ -275,7 +275,7 @@ class RichPaletteAnimationTest
provider_linear.start(0) provider_linear.start(0)
# Create SINE provider # Create SINE provider
var provider_sine = animation.rich_palette(mock_engine) var provider_sine = animation.rich_palette_color(mock_engine)
provider_sine.colors = colors provider_sine.colors = colors
provider_sine.period = 1000 provider_sine.period = 1000
provider_sine.transition_type = animation.SINE provider_sine.transition_type = animation.SINE
@ -326,7 +326,7 @@ class RichPaletteAnimationTest
def test_sine_mode_value_based() def test_sine_mode_value_based()
# Test SINE mode with value-based interpolation # Test SINE mode with value-based interpolation
var colors = bytes("00FF0000" "FF0000FF") # Red to Blue var colors = bytes("00FF0000" "FF0000FF") # Red to Blue
var provider = animation.rich_palette(mock_engine) var provider = animation.rich_palette_color(mock_engine)
provider.colors = colors provider.colors = colors
provider.period = 0 # Value-based mode provider.period = 0 # Value-based mode
provider.transition_type = animation.SINE provider.transition_type = animation.SINE

View File

@ -1,5 +1,5 @@
# Comprehensive Twinkle Animation Test # Comprehensive Twinkle Animation Test
# Tests the TwinkleAnimation class functionality, behavior, and DSL integration # Tests the twinkle class functionality, behavior, and DSL integration
# This test combines all aspects of twinkle animation testing including the fix for DSL parameters # This test combines all aspects of twinkle animation testing including the fix for DSL parameters
import animation import animation
@ -14,7 +14,7 @@ print("=== Comprehensive Twinkle Animation Test ===")
print("\n1. Testing basic twinkle animation creation...") print("\n1. Testing basic twinkle animation creation...")
var strip = global.Leds(30) var strip = global.Leds(30)
var engine = animation.create_engine(strip) var engine = animation.create_engine(strip)
var twinkle = animation.twinkle_animation(engine) var twinkle = animation.twinkle(engine)
twinkle.color = 0xFFFFFFFF twinkle.color = 0xFFFFFFFF
twinkle.density = 128 twinkle.density = 128
twinkle.twinkle_speed = 6 twinkle.twinkle_speed = 6
@ -41,7 +41,7 @@ print(f"Set twinkle_speed to 6000 (invalid): {result4}")
print("\n3. Testing DSL issue reproduction and fix...") print("\n3. Testing DSL issue reproduction and fix...")
print("Creating: twinkle with 0xFFAAAAFF, density=4, twinkle_speed=400ms - original problematic DSL parameters") print("Creating: twinkle with 0xFFAAAAFF, density=4, twinkle_speed=400ms - original problematic DSL parameters")
var dsl_twinkle = animation.twinkle_animation(engine) var dsl_twinkle = animation.twinkle(engine)
dsl_twinkle.color = 0xFFAAAAFF dsl_twinkle.color = 0xFFAAAAFF
dsl_twinkle.density = 4 dsl_twinkle.density = 4
dsl_twinkle.twinkle_speed = 400 # Should convert from 400ms to Hz dsl_twinkle.twinkle_speed = 400 # Should convert from 400ms to Hz
@ -103,7 +103,7 @@ while i < size(time_test_cases)
var input_val = time_test_cases[i][0] var input_val = time_test_cases[i][0]
var description = time_test_cases[i][1] var description = time_test_cases[i][1]
var test_twinkle = animation.twinkle_animation(engine) var test_twinkle = animation.twinkle(engine)
test_twinkle.color = 0xFFFFFFFF test_twinkle.color = 0xFFFFFFFF
test_twinkle.density = 64 test_twinkle.density = 64
test_twinkle.twinkle_speed = input_val test_twinkle.twinkle_speed = input_val
@ -118,7 +118,7 @@ var density_test_cases = [1, 2, 4, 8, 16, 32]
i = 0 i = 0
while i < size(density_test_cases) while i < size(density_test_cases)
var test_density = density_test_cases[i] var test_density = density_test_cases[i]
var density_twinkle = animation.twinkle_animation(engine) var density_twinkle = animation.twinkle(engine)
density_twinkle.color = 0xFFFFFFFF density_twinkle.color = 0xFFFFFFFF
density_twinkle.density = test_density density_twinkle.density = test_density
density_twinkle.twinkle_speed = 6 density_twinkle.twinkle_speed = 6
@ -152,20 +152,6 @@ while i < size(density_test_cases)
i += 1 i += 1
end end
# Test 6: Factory Methods
print("\n6. Testing factory methods...")
var twinkle_classic = animation.twinkle_classic(engine)
var twinkle_solid = animation.twinkle_solid(engine)
var twinkle_rainbow = animation.twinkle_rainbow(engine)
var twinkle_gentle = animation.twinkle_gentle(engine)
var twinkle_intense = animation.twinkle_intense(engine)
print(f"Classic twinkle: {twinkle_classic}")
print(f"Solid twinkle: {twinkle_solid}")
print(f"Rainbow twinkle: {twinkle_rainbow}")
print(f"Gentle twinkle: {twinkle_gentle}")
print(f"Intense twinkle: {twinkle_intense}")
# Test 7: Animation Lifecycle # Test 7: Animation Lifecycle
print("\n7. Testing animation lifecycle...") print("\n7. Testing animation lifecycle...")
twinkle.start() twinkle.start()
@ -240,7 +226,7 @@ print(f"Average non-black pixels per cycle: {total_non_black / size(non_black_co
# Test 9: Deterministic Behavior Test (with fixed seed) # Test 9: Deterministic Behavior Test (with fixed seed)
print("\n9. Testing deterministic behavior...") print("\n9. Testing deterministic behavior...")
var deterministic_twinkle = animation.twinkle_animation(engine) var deterministic_twinkle = animation.twinkle(engine)
deterministic_twinkle.color = 0xFFFF0000 deterministic_twinkle.color = 0xFFFF0000
deterministic_twinkle.density = 64 deterministic_twinkle.density = 64
deterministic_twinkle.twinkle_speed = 10 deterministic_twinkle.twinkle_speed = 10
@ -311,7 +297,7 @@ twinkle.fade_speed = 220
print(f"Updated fade_speed: {twinkle.fade_speed}") print(f"Updated fade_speed: {twinkle.fade_speed}")
# Test parameter updates with time conversion # Test parameter updates with time conversion
var param_update_twinkle = animation.twinkle_animation(engine) var param_update_twinkle = animation.twinkle(engine)
param_update_twinkle.color = 0xFFFFFFFF param_update_twinkle.color = 0xFFFFFFFF
param_update_twinkle.density = 64 param_update_twinkle.density = 64
param_update_twinkle.twinkle_speed = 6 param_update_twinkle.twinkle_speed = 6
@ -347,7 +333,7 @@ print("Set back to white")
# Test 15: High Density Test (should definitely produce visible results) # Test 15: High Density Test (should definitely produce visible results)
print("\n15. Testing high density animation...") print("\n15. Testing high density animation...")
var high_density_twinkle = animation.twinkle_animation(engine) var high_density_twinkle = animation.twinkle(engine)
high_density_twinkle.color = 0xFFFFFFFF high_density_twinkle.color = 0xFFFFFFFF
high_density_twinkle.density = 255 high_density_twinkle.density = 255
high_density_twinkle.twinkle_speed = 20 high_density_twinkle.twinkle_speed = 20
@ -388,7 +374,7 @@ print("\n16. Testing edge cases...")
# Very small strip # Very small strip
var tiny_strip = global.Leds(1) var tiny_strip = global.Leds(1)
var tiny_engine = animation.create_engine(tiny_strip) var tiny_engine = animation.create_engine(tiny_strip)
var tiny_twinkle = animation.twinkle_classic(tiny_engine) var tiny_twinkle = animation.twinkle(tiny_engine)
tiny_twinkle.density = 200 tiny_twinkle.density = 200
tiny_twinkle.start() tiny_twinkle.start()
tiny_twinkle.update(current_time + 167) tiny_twinkle.update(current_time + 167)
@ -397,7 +383,7 @@ tiny_twinkle.render(tiny_frame, current_time, tiny_engine.strip_length)
print("Tiny twinkle (1 pixel) created and rendered successfully") print("Tiny twinkle (1 pixel) created and rendered successfully")
# Zero density # Zero density
var no_twinkle = animation.twinkle_classic(engine) var no_twinkle = animation.twinkle(engine)
no_twinkle.density = 0 no_twinkle.density = 0
no_twinkle.start() no_twinkle.start()
no_twinkle.update(current_time + 334) no_twinkle.update(current_time + 334)
@ -406,7 +392,7 @@ no_twinkle.render(no_frame, current_time, engine.strip_length)
print("No twinkle (0 density) created and rendered successfully") print("No twinkle (0 density) created and rendered successfully")
# Maximum density # Maximum density
var max_twinkle = animation.twinkle_classic(engine) var max_twinkle = animation.twinkle(engine)
max_twinkle.density = 255 max_twinkle.density = 255
max_twinkle.start() max_twinkle.start()
max_twinkle.update(current_time + 501) max_twinkle.update(current_time + 501)
@ -418,7 +404,7 @@ print("Max twinkle (255 density) created and rendered successfully")
print("\n17. Testing alpha-based fading (stars should fade via alpha channel)...") print("\n17. Testing alpha-based fading (stars should fade via alpha channel)...")
# Test new stars start at full brightness with variable alpha # Test new stars start at full brightness with variable alpha
var alpha_test_twinkle = animation.twinkle_animation(engine) var alpha_test_twinkle = animation.twinkle(engine)
alpha_test_twinkle.color = 0xFFFF0000 # Red stars alpha_test_twinkle.color = 0xFFFF0000 # Red stars
alpha_test_twinkle.density = 255 # High density alpha_test_twinkle.density = 255 # High density
alpha_test_twinkle.twinkle_speed = 6 alpha_test_twinkle.twinkle_speed = 6
@ -463,7 +449,7 @@ else
end end
# Test alpha fading over time # Test alpha fading over time
var fade_twinkle = animation.twinkle_animation(engine) var fade_twinkle = animation.twinkle(engine)
fade_twinkle.color = 0xFFFFFFFF # White stars fade_twinkle.color = 0xFFFFFFFF # White stars
fade_twinkle.density = 0 # Zero density fade_twinkle.density = 0 # Zero density
fade_twinkle.twinkle_speed = 6 fade_twinkle.twinkle_speed = 6
@ -517,7 +503,7 @@ else
end end
# Test star reset when alpha reaches zero # Test star reset when alpha reaches zero
var reset_twinkle = animation.twinkle_animation(engine) var reset_twinkle = animation.twinkle(engine)
reset_twinkle.color = 0xFF00FF00 # Green stars reset_twinkle.color = 0xFF00FF00 # Green stars
reset_twinkle.density = 0 # Zero density reset_twinkle.density = 0 # Zero density
reset_twinkle.twinkle_speed = 6 reset_twinkle.twinkle_speed = 6
@ -544,7 +530,7 @@ end
print("\n18. Testing transparency (background should be transparent)...") print("\n18. Testing transparency (background should be transparent)...")
# Test with zero density (no twinkles) - simplified test # Test with zero density (no twinkles) - simplified test
var zero_density_twinkle = animation.twinkle_animation(engine) var zero_density_twinkle = animation.twinkle(engine)
zero_density_twinkle.color = 0xFFFFFFFF zero_density_twinkle.color = 0xFFFFFFFF
zero_density_twinkle.density = 0 # Zero density zero_density_twinkle.density = 0 # Zero density
zero_density_twinkle.twinkle_speed = 6 zero_density_twinkle.twinkle_speed = 6
@ -667,14 +653,14 @@ print("7. ✅ Animation engine integration: DSL parameters work in full system")
# Test 20: Undefined Parameter Exception Test # Test 20: Undefined Parameter Exception Test
print("\n20. Testing undefined parameter exception behavior...") print("\n20. Testing undefined parameter exception behavior...")
# Test setting an undefined attribute 'speed' (which is not defined in TwinkleAnimation PARAMS) # Test setting an undefined attribute 'speed' (which is not defined in twinkle PARAMS)
print("Testing direct assignment to undefined parameter 'speed'...") print("Testing direct assignment to undefined parameter 'speed'...")
var exception_caught = false var exception_caught = false
var actual_exception_type = nil var actual_exception_type = nil
var actual_exception_msg = nil var actual_exception_msg = nil
try try
twinkle.speed = 42 # 'speed' is not defined in TwinkleAnimation PARAMS twinkle.speed = 42 # 'speed' is not defined in twinkle PARAMS
assert(false, "Setting undefined parameter should raise an exception") assert(false, "Setting undefined parameter should raise an exception")
except .. as e, msg except .. as e, msg
exception_caught = true exception_caught = true

View File

@ -192,7 +192,7 @@
"patterns": [ "patterns": [
{ {
"name": "entity.name.function.animation.animation-dsl", "name": "entity.name.function.animation.animation-dsl",
"match": "\\b(solid|pulsating_animation|beacon_animation|comet_animation|rich_palette_animation|twinkle_animation|breathe_animation|fire_animation|crenel_animation)\\b" "match": "\\b(solid|pulsating_animation|beacon_animation|comet_animation|rich_palette_animation|twinkle|breathe_animation|fire_animation|crenel_animation)\\b"
} }
] ]
}, },