mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
Some theme colors can't have one default that suits both dark and light backgrounds. A gray background for the selected line of an inactive view has to be lighter than the terminal's background if that is dark, and darker if it is light. Give such fields a default for each kind of background. Derive it from the terminal's background color if the terminal tells us, so that it keeps the same distance from the background however dark or light that is, and takes on its tint. Otherwise, assume a black or white background. These defaults can't be the defaults of gui.theme. We would then have to tell whether a value there came from the user or from the built-in defaults, because only the user's value should win over a background default. Keep them apart from the user config instead, and leave these fields empty in the defaults of gui.theme, so that a value there always comes from the user. Tests ensure that no field has both kinds of defaults, and that both kinds of background set the same fields. Start with inactiveViewSelectedLineBgColor: the background mixed with 30% white if it is dark (#4d4d4d on black), or with 15% black if it is light (#d9d9d9 on white). A gray background shows where the selection is in a view without the focus more clearly than the bold text we used so far. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>