Fix a light theme that Omarchy insists is a dark one
The precedence chain, the threshold, and the downstream effects are right: bin/omarchy-theme-color resolves mode from the mode key, then legacy theme_type, then a light.mode file beside colors.toml, then (( lum > 382 )) on a bare R+G+B sum out of 765, else dark. From there, omarchy-theme-set-gnome sets prefer-dark + Adwaita-dark on the dark branch, and omarchy-theme-set-tmux exports COLORFGBG=15;0. But the headline half of the cause is backwards. resolve_theme_mode is NOT called inside parse_colors_file. It is called at the very END of resolve_theme_colors (line 279), after every legacy alias has been applied: alias_theme_color background bg runs at lines 192-194 and [[ ${THEME_COLORS[background]} ]] || THEME_COLORS[background]="${THEME_COLORS[color0]}" at line 197. So a theme defining only bg = "#fdf6e3" or only color0 DOES have background set when the mode is decided, and #fdf6e3 sums to 726 > 382, i.e. it is correctly detected as light. Only two things actually produce a wrong dark: a background whose channel sum is 382 or less (the record's own #7d7d7d = 375 example), and a theme with no background under any name (no background, no bg, no color0), which falls through to the literal dark default. The supported fix (mode = "light") is correct and does beat every fallback.
Symptom
You build a light theme. The terminal, bar and shell all come up light, but GNOME/GTK apps (Nautilus, Text Editor, Calendar) open with dark headerbars and dark chrome around your light content, and tmux/nvim behave as though the background were dark. omarchy-theme-color --file ~/.local/state/omarchy/current/theme/colors.toml mode prints dark, and gsettings get org.gnome.desktop.interface color-scheme prints 'prefer-dark'.
Cause
bin/omarchy-theme-color resolves the mode with this precedence: the mode key, then the legacy theme_type key, then a light.mode marker file beside colors.toml, then a background-luminance guess, then dark. resolve_theme_mode runs at the end of resolve_theme_colors, so legacy aliases (bg -> background, color0 -> background) are already in place by then and a short-name palette is not the problem. What goes wrong is the guess itself: it is a bare R + G + B > 382 out of 765, so a muted "light" background such as #7d7d7d (375) is classified dark. A theme that defines no background under any name at all (no background, no bg, no color0) skips the luminance branch entirely and falls straight through to dark. bin/omarchy-theme-set-gnome then sets color-scheme prefer-dark and gtk-theme Adwaita-dark, and bin/omarchy-theme-set-tmux exports COLORFGBG=15;0.
Fix
The fix commands are right as written, so keep them:
omarchy-theme-color --file ~/.local/state/omarchy/current/theme/colors.toml mode
sed -i '1i mode = "light"' ~/.config/omarchy/themes/<name>/colors.toml
omarchy theme set <name>
Drop the claim that the legacy short names "are not resolved in time to feed the luminance guess". They are (omarchy-theme-color aliases bg/color0 to background before resolving the mode). Canonical key names are still worth using for clarity, but they will not change the detected mode. If you would rather not set mode, make sure the theme defines a background (or bg/color0) whose R+G+B exceeds 382. The empty light.mode marker in the theme root next to colors.toml also still works.
Verify
omarchy-theme-color --file ~/.local/state/omarchy/current/theme/colors.toml mode prints light, gsettings get org.gnome.desktop.interface color-scheme prints 'prefer-light', and a freshly launched Nautilus has a light headerbar.
Sources
- https://github.com/basecamp/omarchy/blob/quattro/bin/omarchy-theme-color
- https://github.com/basecamp/omarchy/blob/quattro/bin/omarchy-theme-set-gnome
- https://github.com/basecamp/omarchy/blob/quattro/bin/omarchy-theme-set-tmux
- https://github.com/basecamp/omarchy/blob/quattro/manual/43-making-your-own-theme.md
- https://github.com/basecamp/omarchy/blob/quattro/docs/theming.md