Skip to content

fix(pinball): fix clock overlay, add blink and complementary colors - #59

Merged
ojacques merged 4 commits into
mainfrom
fix/pinball-overlay-blink-colors
Jul 26, 2026
Merged

ojacques merged 4 commits into
mainfrom
fix/pinball-overlay-blink-colors

Conversation

@ojacques

Copy link
Copy Markdown
Contributor

Summary

Fixes broken rendering on ~348 pinball scenes with frame_layer=1 (clock above animation) and improves visual polish.

Changes

Bug fix — clock overlay erasing animation (frame_layer=1)

Scenes like RD0673.scn had the animation completely hidden by the clock's black background. Root cause: the font's DotBlt mask marks only outline pixels as transparent, leaving the entire black background as "opaque" — which erases the animation underneath.

Fix: added overlay_clock_above() in overlay.py that uses pixel-based transparency (any pixel ≤ 2 is transparent) instead of the DotBlt mask. Used for all frame_layer=1 compositions.

Colon blinking

The : in the time display now blinks (toggles every ~500ms) during pinball animations, matching the main clock behavior.

Complementary animation color

Animation color now defaults to the HSV-complementary palette color instead of the same color as the clock. For example: orange clock → blue animation, red → cyan, purple → green.

Added complementary_color() utility in colors.py (HSV hue rotation + nearest palette snap).

Debug script

Added scripts/debug_scene.py for analyzing .scn rendering issues (frame dump, overlay preview, virtual DMD playback).

Testing

  • All 676 tests pass
  • Verified visually with virtual DMD on multiple scene types (layer0/1, with/without mask, centered/custom clock position, all 8 palette colors)

ojacques added 4 commits July 26, 2026 11:31
…lors

- Fix frame_layer=1 scenes: clock overlay was erasing animation due to
  incorrect DotBlt mask semantics. Added overlay_clock_above() that uses
  pixel-based transparency instead of the font's DotBlt mask.

- Add colon blinking during pinball animations (toggles every ~500ms),
  matching the main clock behavior.

- Animation color now defaults to the HSV-complementary palette color
  (e.g. orange clock -> blue animation) instead of the same color.
  Added complementary_color() utility in colors.py.

- Add scripts/debug_scene.py for .scn rendering analysis and debugging.
PluginManager now exposes current_color (set by ZeClock on every color
change in auto mode). Pinball plugin reads _current_color from config
so it matches the clock's active color at activation time.

This ensures the pinball clock overlay uses the same color as the main
clock even in auto-rotate mode, rather than always defaulting to orange.
The clock plugin has its own color palette (includes white) and its own
auto-rotate cycle, independent from ZeClock's COLOR_LIST. Previously the
pinball got ZeClock's color which was out of sync with what the user
actually sees.

Now PluginManager._get_default_plugin_color() reads _current_color
directly from the default plugin instance, so the pinball clock overlay
always matches the color displayed between animations.
Color is now read directly from the default plugin instance via
_get_default_plugin_color(). The intermediate current_color attribute
and its update in the main loop are no longer needed.
@ojacques
ojacques merged commit dd033f5 into main Jul 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant