summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-09-17 19:38:49 +0900
committerGitHub <noreply@github.com>2025-09-17 19:38:49 +0900
commit2a92c7d792b45112ab82eef0be2aa11038e6185d (patch)
tree001879596aad0192e5e0fa20cde3e78c96e1b6ce /src
parentf5975cf87029522cc6f6d18e83ae531005e0cb64 (diff)
downloadfzf-2a92c7d792b45112ab82eef0be2aa11038e6185d.tar.gz
Adjust base16 (16) theme (#4501)
Motivation: `--color base16` can be a better default than `dark` or `light`, since it uses the colors defined by the current theme. This usually blends in more naturally and works well in both light and dark modes. However, some elements were previously hard-coded with white or black foreground colors, which can cause rendering issues in certain terminal themes.
Diffstat (limited to 'src')
-rw-r--r--src/options.go4
-rw-r--r--src/tui/tui.go20
2 files changed, 16 insertions, 8 deletions
diff --git a/src/options.go b/src/options.go
index 5e89a261..71782bf2 100644
--- a/src/options.go
+++ b/src/options.go
@@ -59,7 +59,7 @@ Usage: fzf [options]
GLOBAL STYLE
--style=PRESET Apply a style preset [default|minimal|full[:BORDER_STYLE]
- --color=COLSPEC Base scheme (dark|light|16|bw) and/or custom colors
+ --color=COLSPEC Base scheme (dark|light|base16|bw) and/or custom colors
--no-color Disable colors
--no-bold Do not use bold text
@@ -1326,7 +1326,7 @@ func parseTheme(defaultTheme *tui.ColorTheme, str string) (*tui.ColorTheme, erro
theme = dupeTheme(tui.Dark256)
case "light":
theme = dupeTheme(tui.Light256)
- case "16":
+ case "base16", "16":
theme = dupeTheme(tui.Default16)
case "bw", "no":
theme = tui.NoColorTheme()
diff --git a/src/tui/tui.go b/src/tui/tui.go
index 965be337..106d6c86 100644
--- a/src/tui/tui.go
+++ b/src/tui/tui.go
@@ -303,6 +303,14 @@ const (
colMagenta
colCyan
colWhite
+ colGrey
+ colBrightRed
+ colBrightGreen
+ colBrightYellow
+ colBrightBlue
+ colBrightMagenta
+ colBrightCyan
+ colBrightWhite
)
type FillReturn int
@@ -923,19 +931,19 @@ func init() {
SelectedFg: ColorAttr{colUndefined, AttrUndefined},
SelectedBg: ColorAttr{colUndefined, AttrUndefined},
SelectedMatch: ColorAttr{colUndefined, AttrUndefined},
- DarkBg: ColorAttr{colBlack, AttrUndefined},
+ DarkBg: ColorAttr{colGrey, AttrUndefined},
Prompt: ColorAttr{colBlue, AttrUndefined},
Match: ColorAttr{colGreen, AttrUndefined},
- Current: ColorAttr{colYellow, AttrUndefined},
- CurrentMatch: ColorAttr{colGreen, AttrUndefined},
+ Current: ColorAttr{colBrightWhite, AttrUndefined},
+ CurrentMatch: ColorAttr{colBrightGreen, AttrUndefined},
Spinner: ColorAttr{colGreen, AttrUndefined},
- Info: ColorAttr{colWhite, AttrUndefined},
+ Info: ColorAttr{colYellow, AttrUndefined},
Cursor: ColorAttr{colRed, AttrUndefined},
Marker: ColorAttr{colMagenta, AttrUndefined},
Header: ColorAttr{colCyan, AttrUndefined},
Footer: ColorAttr{colCyan, AttrUndefined},
- Border: ColorAttr{colBlack, AttrUndefined},
- BorderLabel: ColorAttr{colWhite, AttrUndefined},
+ Border: ColorAttr{colDefault, Dim},
+ BorderLabel: ColorAttr{colDefault, AttrUndefined},
Ghost: ColorAttr{colUndefined, Dim},
Disabled: ColorAttr{colUndefined, AttrUndefined},
PreviewFg: ColorAttr{colUndefined, AttrUndefined},