diff --git a/docs-master/Config.md b/docs-master/Config.md index 10512c81a..1452694b7 100644 --- a/docs-master/Config.md +++ b/docs-master/Config.md @@ -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 diff --git a/pkg/theme/gocui.go b/pkg/theme/gocui.go index 101f1d889..274d4a576 100644 --- a/pkg/theme/gocui.go +++ b/pkg/theme/gocui.go @@ -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, diff --git a/pkg/theme/gocui_test.go b/pkg/theme/gocui_test.go index 7610c95d5..1de847c4d 100644 --- a/pkg/theme/gocui_test.go +++ b/pkg/theme/gocui_test.go @@ -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 { diff --git a/pkg/theme/style.go b/pkg/theme/style.go index 43e81315d..8e744d21f 100644 --- a/pkg/theme/style.go +++ b/pkg/theme/style.go @@ -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": diff --git a/pkg/theme/style_test.go b/pkg/theme/style_test.go index e20191b55..0208aea2f 100644 --- a/pkg/theme/style_test.go +++ b/pkg/theme/style_test.go @@ -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"},