Skip to content

Add smooth timer colour gradient - #67

Merged
PurpleSentinel merged 1 commit into
v4.1from
feature/issue-66-timer-colour-gradient
Aug 10, 2026
Merged

Add smooth timer colour gradient#67
PurpleSentinel merged 1 commit into
v4.1from
feature/issue-66-timer-colour-gradient

Conversation

@PurpleSentinel

Copy link
Copy Markdown
Contributor

Summary

  • replace abrupt 85% and 95% warning backgrounds with a continuous progress-based gradient
  • move through green, yellow, amber, and red using evenly spaced session-percentage anchors
  • use a deep-purple overrun state with white text
  • choose black or white timer text automatically using WCAG-style contrast
  • preserve once-per-displayed-second framebuffer updates and existing rest-session behaviour

Why

The previous discrete colour changes did not communicate progress smoothly and did not follow the requested traffic-light progression. The new renderer makes the background a continuous visual indication of elapsed session percentage for every configured duration while retaining strong timer readability.

Implementation

  • interpolate in RGB888 with rounded integer arithmetic
  • convert only the final colour to the GC9A01 framebuffer's byte-swapped RGB565 value
  • derive colour from whole elapsed seconds so no second framebuffer or frame cache is required
  • select whichever of black or white provides the higher contrast against each generated background

Impact

  • fixed and Auto rotation, Launch Mode, stop gestures, timer digits, and saved settings are unchanged
  • rest-session and Ready-screen colours remain unchanged
  • normal full-frame transfers remain bounded to one per displayed second

Validation

  • python -m unittest discover -s tests — 143 tests passed
  • deployed to the connected Waveshare RP2040 under MicroPython 1.21.0
  • clean application startup confirmed with saved settings restored and no traceback
  • 601 gradient and contrast calculations completed on-device in 261,370 microseconds with no retained heap growth

Closes#66
Resolves#2

@PurpleSentinel
PurpleSentinel merged commit 7958a4a into v4.1Aug 10, 2026
2 checks passed
@PurpleSentinel
PurpleSentinel deleted the feature/issue-66-timer-colour-gradient branch August 10, 2026 19:36
Sign up for freeto 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.

2 participants

@PurpleSentinel@markr-sqr