Fix nonlocal scoping in CSS processing, move brightness source emoji to dropdown items

Add nonlocal declarations for _u16_a, _u16_b, _i32 in nested functions
_blend_u16 and _apply_corrections — Python treats augmented assignments
(*=, +=, >>=) as local variable bindings, causing UnboundLocalError
that prevented any frames from being sent to devices.

Move 🔢 emoji from brightness source label to dropdown option items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 01:34:35 +03:00
parent 359f33fdbb
commit 16f29bee30
5 changed files with 8 additions and 10 deletions

View File

@@ -305,6 +305,7 @@ class PictureColorStripStream(ColorStripStream):
Uses pre-allocated uint16 scratch buffers (_u16_a, _u16_b).
"""
nonlocal _u16_a, _u16_b
np.copyto(_u16_a, a, casting='unsafe')
np.copyto(_u16_b, b, casting='unsafe')
_u16_a *= (256 - alpha_b)
@@ -318,6 +319,7 @@ class PictureColorStripStream(ColorStripStream):
Returns the (possibly reassigned) led_colors array.
"""
nonlocal _i32
if self._saturation != 1.0:
_apply_saturation(led_colors, self._saturation, _i32, _i32_gray, led_colors)
if self._gamma != 1.0: