Skip to content

system/ui: fix rapid path color transition by correcting hardcoded increment#35368

Merged
adeebshihadeh merged 1 commit intocommaai:masterfrom
deanlee:pyui_refactor_color_blending
May 28, 2025
Merged

system/ui: fix rapid path color transition by correcting hardcoded increment#35368
adeebshihadeh merged 1 commit intocommaai:masterfrom
deanlee:pyui_refactor_color_blending

Conversation

@deanlee
Copy link
Copy Markdown
Contributor

@deanlee deanlee commented May 28, 2025

The path color transition between throttle and no-throttle states was completing too quickly (~0.17 seconds instead of the intended 0.5 seconds). This was caused by a hardcoded increment of 0.1, designed for 20 FPS, which became too fast at the current 60 FPS.

This PR fixes the transition duration to achieve the intended 0.5 seconds by adjusting the increment based on the frame rate. Additionally, it optimizes the color blending function for better performance.

Changes:

  • Fixed Transition Duration: Adjusted the hardcoded increment (from 0.1) to scale with the frame rate (60 FPS), ensuring a smooth 0.5-second transition.
  • Optimized Color Blending: Modified the color blending function to reuse an existing array instead of creating a new list each frame, reducing memory allocation overhead.

@github-actions github-actions Bot added the ui label May 28, 2025
@deanlee deanlee force-pushed the pyui_refactor_color_blending branch from a3c327d to b8c7c6b Compare May 28, 2025 16:59
@adeebshihadeh adeebshihadeh merged commit db8ecf1 into commaai:master May 28, 2025
6 of 15 checks passed
@deanlee deanlee deleted the pyui_refactor_color_blending branch May 28, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants