You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Borders get too bright with very dark custom background colors #16114
Hey, I've been using Dark Reader with custom colors synced from my desktop theme and noticed that on very dark backgrounds the borders on light sites stand out way too much, almost like highlighted rows. With a mid-dark background they look fine.
Example on GitHub's file list (its borders are #d1d9e0):
background #2d353b → border #364047, contrast 1.18, looks right
background #001419 → border #00647d, contrast 2.80, looks like every row is highlighted
I dug into it and it comes from modifyBorderHSL in src/inject/dynamic-theme/modify-colors.ts. The lightness there is absolute:
constlx=scale(l,0,1,0.5,0.2);
so borders always end up around 0.2–0.5 lightness no matter how dark the background is. On top of that, light neutral borders take the background's hue and saturation, which is why a saturated dark background turns them cyan.
I tried making it relative to the background and it fixed it for me:
0.21 is roughly where the current output already looks good, so mid-dark backgrounds barely change, and darker ones get proportionally darker borders. With that patch, the same GitHub borders come out at contrast ~1.14 on #001419, 1.15 on #2d353b, 1.09 on Tokyo Night #1a1b26 and 1.05 on pure black, and the page background stays exactly the same.
I'm running it locally in Zen now with no issues. Happy to open a PR if you think this is the right direction, or adjust it however you prefer.
Modifying the low-level color transformation logic in modify-colors.ts affects dynamic calculations globally across millions of websites and diverse element types. Before considering any PR or changes to core color math, we need visual proof that this adjustment does not cause contrast regressions.
Please provide clear side-by-side comparison screenshots (Before vs After the proposed patch) for the following scenarios:
Custom Dark Scheme (the specific setup reported).
Custom Light Scheme (confirming that custom light configurations do not wash out borders or destroy element separation).
Default Dark Scheme (confirming that default borders maintain proper visibility, contrast, and visual separation).
Default Light Scheme (confirming that standard borders do not disappear or invert improperly).
Providing visual validation across both default and custom configurations is required before this can be evaluated further.
Activity
Myshor commentedon Oct 19, 2026
Modifying the low-level color transformation logic in
modify-colors.tsaffects dynamic calculations globally across millions of websites and diverse element types. Before considering any PR or changes to core color math, we need visual proof that this adjustment does not cause contrast regressions.Please provide clear side-by-side comparison screenshots (Before vs After the proposed patch) for the following scenarios:
Providing visual validation across both default and custom configurations is required before this can be evaluated further.