summaryrefslogtreecommitdiffstats
path: root/pkg/gui/style
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-11-01 09:16:45 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-11-01 10:03:49 +1100
commit7a464ae5b7782b383050de6dc3ae5bd51a88bad0 (patch)
tree1af89e884fdd44c34889a6d1f017d7838a293a28 /pkg/gui/style
parent927ee631061fbc3c86c4d73ac5056d8b4bd84c81 (diff)
add graph algorithm
Diffstat (limited to 'pkg/gui/style')
-rw-r--r--pkg/gui/style/basic_styles.go7
-rw-r--r--pkg/gui/style/style_test.go8
2 files changed, 11 insertions, 4 deletions
diff --git a/pkg/gui/style/basic_styles.go b/pkg/gui/style/basic_styles.go
index 92b034f06..99db37e20 100644
--- a/pkg/gui/style/basic_styles.go
+++ b/pkg/gui/style/basic_styles.go
@@ -1,8 +1,9 @@
package style
import (
- "github.com/gookit/color"
"text/template"
+
+ "github.com/gookit/color"
)
var (
@@ -16,6 +17,7 @@ var (
FgBlue = FromBasicFg(color.FgBlue)
FgYellow = FromBasicFg(color.FgYellow)
FgMagenta = FromBasicFg(color.FgMagenta)
+ FgDefault = FromBasicFg(color.FgDefault)
BgWhite = FromBasicBg(color.BgWhite)
BgBlack = FromBasicBg(color.BgBlack)
@@ -26,6 +28,9 @@ var (
BgMagenta = FromBasicBg(color.BgMagenta)
BgCyan = FromBasicBg(color.BgCyan)
+ // will not print any colour escape codes, including the reset escape code
+ Nothing = New()
+
AttrUnderline = New().SetUnderline()
AttrBold = New().SetBold()
diff --git a/pkg/gui/style/style_test.go b/pkg/gui/style/style_test.go
index cadd3c397..ecf316705 100644
--- a/pkg/gui/style/style_test.go
+++ b/pkg/gui/style/style_test.go
@@ -10,6 +10,11 @@ import (
"github.com/xo/terminfo"
)
+func init() {
+ // on CI we've got no color capability so we're forcing it here
+ color.ForceSetColorLevel(terminfo.ColorLevelMillions)
+}
+
func TestMerge(t *testing.T) {
type scenario struct {
name string
@@ -18,9 +23,6 @@ func TestMerge(t *testing.T) {
expectedStr string
}
- // on CI we've got no color capability so we're forcing it here
- color.ForceSetColorLevel(terminfo.ColorLevelMillions)
-
fgRed := color.FgRed
bgRed := color.BgRed
fgBlue := color.FgBlue