Make the Claude Code statusline follow the terminal palette
The nine colours were hardcoded One Dark RGB via 38;2;R;G;B, so they did not follow the light/dark switch. Measured against the tangere backgrounds they are fine on dark (4.25-10.80:1) but collapse on light: orange 1.78, amber 1.70, yellow 1.63, and 'white' — used for the token total — at 1.35:1, effectively invisible. Switched to palette indices, which resolve through the terminal's own palette and so follow the ghostty tangere-light/tangere-dark swap with no detection and no cost per render. 'white' becomes 39, default foreground, since it means primary text. All seven colours actually used get distinct indices; blue and yellow are unreferenced but converted too, so no RGB is left behind. Contrast now clears WCAG AA in both modes: 5.77-14.26:1 on dark, 6.32-20.61:1 on light. Trade-off: tangere has no orange and its palette 2 is teal rather than green, so 'green' reads teal and the warm colours sit closer together than the One Dark originals did. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
39d52fbbcf
commit
d012a7f23e
1 changed files with 16 additions and 9 deletions
|
|
@ -37,15 +37,22 @@ input=$(cat)
|
||||||
mkdir -p /tmp/claude
|
mkdir -p /tmp/claude
|
||||||
|
|
||||||
# ===== Colors =====
|
# ===== Colors =====
|
||||||
blue='\033[38;2;97;175;239m'
|
# Palette indices rather than RGB, so these resolve through the terminal's own
|
||||||
orange='\033[38;2;255;176;85m'
|
# palette and follow the ghostty tangere-light/tangere-dark swap for free. No
|
||||||
amber='\033[38;2;229;192;123m'
|
# appearance detection, so no cost per statusline render.
|
||||||
green='\033[38;2;80;200;120m'
|
#
|
||||||
cyan='\033[38;2;86;182;194m'
|
# The previous values were One Dark RGB: fine on dark (4.3-10.8:1) but 1.35-3.4:1
|
||||||
red='\033[38;2;235;87;87m'
|
# on a light background, with 'white' effectively invisible. These clear WCAG AA
|
||||||
yellow='\033[38;2;230;200;0m'
|
# in both modes (5.8-14.3:1 on dark, 6.3-20.6:1 on light).
|
||||||
white='\033[38;2;220;220;220m'
|
blue='\033[38;5;4m'
|
||||||
magenta='\033[38;2;198;120;221m'
|
orange='\033[38;5;3m'
|
||||||
|
amber='\033[38;5;11m'
|
||||||
|
green='\033[38;5;2m'
|
||||||
|
cyan='\033[38;5;14m'
|
||||||
|
red='\033[38;5;1m'
|
||||||
|
yellow='\033[38;5;3m'
|
||||||
|
white='\033[39m'
|
||||||
|
magenta='\033[38;5;5m'
|
||||||
dim='\033[2m'
|
dim='\033[2m'
|
||||||
reset='\033[0m'
|
reset='\033[0m'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue