From a8b6693f7e7bdcc8b73c3fa0baa0ef5f51993dc7 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 15 Jan 2023 23:07:05 +0100 Subject: stylesets: add support for dim text Allow defining .dim=true to turn on half-bright text. Signed-off-by: Robin Jarry Acked-by: Moritz Poldrack --- config/style.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/style.go b/config/style.go index 3e4a9597..5ce2c1cf 100644 --- a/config/style.go +++ b/config/style.go @@ -106,6 +106,7 @@ type Style struct { Underline bool Reverse bool Italic bool + Dim bool } func (s Style) Get() tcell.Style { @@ -116,7 +117,8 @@ func (s Style) Get() tcell.Style { Blink(s.Blink). Underline(s.Underline). Reverse(s.Reverse). - Italic(s.Italic) + Italic(s.Italic). + Dim(s.Dim) } func (s *Style) Normal() { @@ -125,6 +127,7 @@ func (s *Style) Normal() { s.Underline = false s.Reverse = false s.Italic = false + s.Dim = false } func (s *Style) Default() *Style { @@ -200,6 +203,12 @@ func (s *Style) Set(attr, val string) error { } else { s.Italic = state } + case "dim": + if state, err := boolSwitch(val, s.Dim); err != nil { + return err + } else { + s.Dim = state + } case "default": s.Default() case "normal": @@ -235,6 +244,9 @@ func (s Style) composeWith(styles []*Style) Style { if st.Italic != s.Italic { newStyle.Italic = st.Italic } + if st.Dim != s.Dim { + newStyle.Dim = st.Dim + } } return newStyle } -- cgit