Skip to content

Commit 210cd93

Browse files
committed
fix: bandwidth chart labels readable in light theme
1 parent e8af868 commit 210cd93

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/renderer/renderer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ function updateBandwidthGraph(rxSpeed, txSpeed) {
467467
const maxVal = Math.max(...allValues, 1024); // min 1 KB/s scale
468468

469469
// Grid lines
470-
ctx.strokeStyle = 'rgba(255,255,255,0.05)';
470+
const isLight = document.documentElement.getAttribute('data-theme') === 'light';
471+
ctx.strokeStyle = isLight ? 'rgba(0,0,0,0.06)' : 'rgba(255,255,255,0.05)';
471472
ctx.lineWidth = 1;
472473
for (let i = 1; i < 4; i++) {
473474
const y = (h / 4) * i;
@@ -478,7 +479,7 @@ function updateBandwidthGraph(rxSpeed, txSpeed) {
478479
}
479480

480481
// Scale label
481-
ctx.fillStyle = 'rgba(255,255,255,0.2)';
482+
ctx.fillStyle = isLight ? 'rgba(0,0,0,0.3)' : 'rgba(255,255,255,0.2)';
482483
ctx.font = '9px monospace';
483484
ctx.fillText(formatSpeed(maxVal), 2, 10);
484485

@@ -520,7 +521,7 @@ function updateBandwidthGraph(rxSpeed, txSpeed) {
520521
ctx.fillRect(w - 90, 4, 8, 8);
521522
ctx.fillStyle = 'rgba(59, 130, 246, 0.8)';
522523
ctx.fillRect(w - 90, 16, 8, 8);
523-
ctx.fillStyle = 'rgba(255,255,255,0.4)';
524+
ctx.fillStyle = isLight ? 'rgba(0,0,0,0.5)' : 'rgba(255,255,255,0.4)';
524525
ctx.font = '9px sans-serif';
525526
ctx.fillText('↓ Download', w - 78, 12);
526527
ctx.fillText('↑ Upload', w - 78, 24);

0 commit comments

Comments
 (0)