Skip to content

Fix theme-aware chart colour selection - #147

Merged
MrAlders0n merged 3 commits into
MeshCore-Beacon:devfrom
Bjorkan:fix/theme-aware-chart-colors
Oct 10, 2026
Merged

MrAlders0n merged 3 commits into
MeshCore-Beacon:devfrom
Bjorkan:fix/theme-aware-chart-colors

Conversation

@Bjorkan

@Bjorkan Bjorkan commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

AI disclosure: This entire pull request was written by OpenAI GPT-5.

What this PR does

Replaces the fixed chart-series token order and RGB blends with a categorical
palette derived from the active theme. Some themes reuse semantic colours — for
example, Phosphor and Radar use the same value for primary and green — which
made unrelated chart series identical or nearly indistinguishable.

  • Uses OKLCH distance and background contrast to keep categorical series distinct.
  • Reserves green, yellow, and red colour families for success, warning, and error semantics.
  • Uses primary for neutral single-series charts, generated colours for categories and comparisons, and primary-derived ramps for sequential data.
  • Validates contrast and colour separation across all 18 bundled themes.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Tests
  • Docs / config
  • Other:

Checklist

  • npm run build passes (the real typecheck)
  • npm run lint passes
  • npm test passes
  • New logic has tests (TDD for bugfixes and features)
  • Frontend types still match the beacon-server contract
  • I have read CONTRIBUTING.md

Testing notes

  • npm test — 1206 passed
  • npm run build
  • npm run lint — 0 errors, 2 pre-existing warnings
  • Verified the generated palette against every bundled dark and light theme.

Reviewers should pay particular attention to multi-series charts in the
Phosphor, Radar, Amber, and Earth themes, which previously contained duplicate
semantic colours.

Beacon graffärger före och efter

@Bjorkan
Bjorkan requested a review from MrAlders0n as a code owner October 4, 2026 08:24
Keeps every theme's own series colours and swaps in a generated hue only
where a slot duplicates an earlier one (Phosphor/Radar primary = green,
Amber/Earth green = secondary). Multi-colour views use the deduplicated
series slots; single-series charts keep their theme tokens.
@MrAlders0n
MrAlders0n merged commit b453b8d into MeshCore-Beacon:dev Oct 10, 2026
2 checks passed
@Bjorkan
Bjorkan deleted the fix/theme-aware-chart-colors branch October 10, 2026 14:11
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