summaryrefslogtreecommitdiffstats
path: root/src/tui/tui.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/tui/tui.go')
-rw-r--r--src/tui/tui.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tui/tui.go b/src/tui/tui.go
index e07e6618..edbc9a14 100644
--- a/src/tui/tui.go
+++ b/src/tui/tui.go
@@ -124,6 +124,10 @@ const (
type Color int32
+func (c Color) IsDefault() bool {
+ return c == colDefault
+}
+
func (c Color) is24() bool {
return c > 0 && (c&(1<<24)) > 0
}
@@ -190,6 +194,11 @@ func (p ColorPair) Attr() Attr {
return p.attr
}
+func (p ColorPair) HasBg() bool {
+ return p.attr&Reverse == 0 && p.bg != colDefault ||
+ p.attr&Reverse > 0 && p.fg != colDefault
+}
+
func (p ColorPair) merge(other ColorPair, except Color) ColorPair {
dup := p
dup.attr = dup.attr.Merge(other.attr)