mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-28 02:07:09 -04:00
Allow dim in theme colors
The faint attribute makes text recede on dark and light backgrounds alike, without having to pick a gray for each. Let users use it in the theme. Some theme colors go through both GetTextStyle and GetGocuiStyle, so both have to know it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c236214c29
commit
8e1f652a35
@@ -1017,6 +1017,7 @@ The available attributes are:
|
||||
|
||||
- bold
|
||||
- default
|
||||
- dim # faint text; not supported by every terminal
|
||||
- reverse # useful for high-contrast
|
||||
- underline
|
||||
- strikethrough
|
||||
|
||||
@@ -17,6 +17,7 @@ var gocuiColorMap = map[string]gocui.Attribute{
|
||||
"cyan": gocui.ColorCyan,
|
||||
"white": gocui.ColorWhite,
|
||||
"bold": gocui.AttrBold,
|
||||
"dim": gocui.AttrDim,
|
||||
"reverse": gocui.AttrReverse,
|
||||
"underline": gocui.AttrUnderline,
|
||||
"strikethrough": gocui.AttrStrikeThrough,
|
||||
|
||||
@@ -28,6 +28,11 @@ func TestGetGocuiStyle(t *testing.T) {
|
||||
keys: []string{"red", "strikethrough"},
|
||||
expected: gocui.ColorRed | gocui.AttrStrikeThrough,
|
||||
},
|
||||
{
|
||||
name: "dim",
|
||||
keys: []string{"default", "dim"},
|
||||
expected: gocui.ColorDefault | gocui.AttrDim,
|
||||
},
|
||||
}
|
||||
|
||||
for _, scenario := range scenarios {
|
||||
|
||||
@@ -13,6 +13,8 @@ func GetTextStyle(keys []string, background bool) style.TextStyle {
|
||||
switch key {
|
||||
case "bold":
|
||||
s = s.SetBold()
|
||||
case "dim":
|
||||
s = s.SetDim()
|
||||
case "reverse":
|
||||
s = s.SetReverse()
|
||||
case "underline":
|
||||
|
||||
@@ -39,6 +39,12 @@ func TestGetTextStyle(t *testing.T) {
|
||||
background: false,
|
||||
expected: style.New().SetFg(style.NewRGBColor(color.RGBColor{0x12, 0x34, 0x56, 0})),
|
||||
},
|
||||
{
|
||||
name: "dim",
|
||||
keys: []string{"dim"},
|
||||
background: false,
|
||||
expected: style.New().SetDim(),
|
||||
},
|
||||
{
|
||||
name: "hex color, bg",
|
||||
keys: []string{"#abcdef"},
|
||||
|
||||
Reference in New Issue
Block a user