Skip to content

fix(staged): align badge hue slider track with OKLCH badge colors#870

Merged
matt2e merged 2 commits into
mainfrom
color-picker-not-aligned
Jul 9, 2026
Merged

fix(staged): align badge hue slider track with OKLCH badge colors#870
matt2e merged 2 commits into
mainfrom
color-picker-not-aligned

Conversation

@matt2e

@matt2e matt2e commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

The badge hue slider in the actions settings panel used a hardcoded HSL gradient for its track, but the badge colors themselves are computed in OKLCH. HSL and OKLCH hue angles don't line up, so the color shown under the slider thumb didn't match the badge color the selected hue actually produced.

  • Add hueSliderGradient() to badgeColors.ts, which builds the track gradient from OKLCH stops sampled every 15° so the track matches the real badge colors
  • Use mid-lightness/mid-chroma stops (0.55 lightness in dark mode, 0.80 in light) so hues stay distinguishable — badge background stops were too pale and foreground stops too dark
  • Apply the gradient as an inline style that follows the current theme via the darkMode store, replacing the static CSS gradient

🤖 Generated with Claude Code

matt2e and others added 2 commits July 9, 2026 10:37
The hue slider track in repo settings was drawn with an HSL gradient,
but badge colors are computed in OKLCH. HSL hue angles don't line up
with OKLCH hue angles (sRGB red sits near 29 in OKLCH, blue near 264),
so the color under the thumb didn't match the badge the selected hue
produced, and the track's lightness/intensity didn't match either.

Generate the track gradient from the same badgeFg() OKLCH values used
to render badges, sampled every 15 degrees, and apply it as a
theme-aware inline style so it also adapts to dark mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
The track sampled badgeFg (L=0.45 in light mode), which looked much
darker than the pale badge backgrounds it selects. Sample a dedicated
mid-lightness stop instead — oklch(0.80 0.10 h) light, oklch(0.55 0.10
h) dark — sitting between badgeBg (too pale to tell hues apart) and
badgeFg (too dark to read as the badge tint), and add a subtle border
so the pastel track stays crisp against the panel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners July 9, 2026 02:21
@matt2e matt2e merged commit e2bf1ba into main Jul 9, 2026
4 checks passed
@matt2e matt2e deleted the color-picker-not-aligned branch July 9, 2026 03:01
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