fix(cliamp hook): readable accent + correct fg/bright_fg brightness - #3
Merged
OldJobobo merged 1 commit intoJun 15, 2026
Merged
Conversation
The cliamp theme-set hook mapped accent=color4 and bright_fg/fg=color15/color7 verbatim. On monochrome/matte palettes color4 is a dark, low-contrast colour, yet cliamp uses accent for the title, seek bar and the key-hint background -> those become unreadable. Some palettes also define color15 darker than color7, which inverts cliamp's normal/dim text brightness. Pick bright_fg/fg by luminance (bright_fg always the brighter), and fall back to a readable, preferably coloured accent when color4 is too close to the bg.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The cliamp theme-set hook (
theme-set.d/50-cliamp.sh) writes~/.config/cliamp/themes/omarchy.tomlwith a verbatim mapping:This breaks colours for some Omarchy themes, with the only workaround being
rm -rf ~/.config/cliamp/themes/. Two issues, measured on a matte/monochrometheme (
background #121212):accent = color4is unreadable. cliamp usesaccentfor the title, theseek bar and the key-hint background. On monochrome palettes color4 is a
dark colour (e.g.
#605d5b, contrast 2.87:1 vs bg, below WCAG 3:1) →those elements become invisible.
bright_fg/fgaren't ordered by brightness. cliamp usesbright_fgfor normal text and
fgfor dimmed text, sobright_fgmust be the brighterof the two. Some palettes define
color15darker thancolor7(
#a4a4a4vs#dbd9d3), so dimmed text ends up brighter than normaltext → "wrong / too bright" colours.
(
rmonly "helps" because cliamp then can't find the theme,SetThemereturnsfalse, and cliamp falls back to its ANSI defaults.)
Fix
bright_fg/fgfromcolor7/color15by luminance, sobright_fgis always the brighter one.
accent = normal_bluewhen it has enough contrast against thebackground; otherwise fall back to the first readable, preferably coloured
candidate (
bright_blue,normal_cyan,normal_yellow,normal_green,normal_red), and only to the foreground colour as a last resort.Pure integer luminance, no new dependencies. Verified on the affected theme:
accent #605d5b → #b7a798(readable),bright_fg #a4a4a4 → #dbd9d3,fg #dbd9d3 → #a4a4a4(correct order).Context: this was originally (mis)filed as a cliamp validation issue
(bjarneo/cliamp#260) — the user themes are complete and valid; the real fix is
here in the hook's colour mapping.