Skip to content

refactor: consolidate color utilities and require theme colors in pipeline#753

Merged
lcottercertinia merged 1 commit intocertinia:mainfrom
lukecotter:chore-require-theme-colors-in-pipeline
Apr 14, 2026
Merged

refactor: consolidate color utilities and require theme colors in pipeline#753
lcottercertinia merged 1 commit intocertinia:mainfrom
lukecotter:chore-require-theme-colors-in-pipeline

Conversation

@lukecotter
Copy link
Copy Markdown
Contributor

📝 PR Overview

Consolidate color conversion utilities into ColorUtils and make batchColors (theme colors) a required parameter across the rendering pipeline. Previously, if theme colors weren't passed, the code silently fell back to hardcoded CATEGORY_COLORS defaults — rendering the timeline with wrong colors instead of the user's theme without any indication. This refactor makes that a compile-time error.

🛠️ Changes made

  • Move blendWithBackground, cssColorToPixi, and DEFAULT_BACKGROUND_COLOR from BucketColorResolver to ColorUtils, making ColorUtils the single module for all color conversion and blending
  • Remove hardcoded CATEGORY_COLORS constant from BucketColorResolver — theme-provided batchColors is now the sole color source
  • Make batchColors required in resolveColor, getCulledRectangles, TemporalSegmentTree.query, legacyCullRectangles, and resolveBucketSearchColor
  • Remove unused setBatchColors methods and cached batchColors field from TemporalSegmentTree and RectangleCache
  • Add tests for blendWithBackground and cssColorToPixi in ColorUtils.test.ts

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🙅 not needed

…back

Move blendWithBackground, cssColorToPixi, and DEFAULT_BACKGROUND_COLOR
from BucketColorResolver to ColorUtils, making ColorUtils the single
module for all color conversion and blending.

Make batchColors required across the rendering pipeline (resolveColor,
getCulledRectangles, TemporalSegmentTree.query, legacyCullRectangles,
resolveBucketSearchColor) so theme colors are always explicitly passed
rather than silently falling back to hardcoded defaults. Remove unused
setBatchColors methods and cached batchColors field from both
TemporalSegmentTree and RectangleCache.
@lcottercertinia lcottercertinia merged commit ec5c1f1 into certinia:main Apr 14, 2026
5 checks 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.

2 participants