From 75004e1298b530fa2a3231b9c9f25441a32b35d4 Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Wed, 28 Aug 2019 21:13:45 +0200 Subject: bug: rename RGBA to Color --- termui/label_select.go | 7 ++++++- termui/show_bug.go | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'termui') diff --git a/termui/label_select.go b/termui/label_select.go index 131703f9..e0f97279 100644 --- a/termui/label_select.go +++ b/termui/label_select.go @@ -127,7 +127,12 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { if ls.labelSelect[i] { selectBox = " [x] " } - fmt.Fprint(v, selectBox, label) + + lc := label.Color() + lc256 := lc.Term256() + labelStr := lc256.Escape() + "◼ " + lc256.Unescape() + label.String() + fmt.Fprint(v, selectBox, labelStr) + y0 += 2 } diff --git a/termui/show_bug.go b/termui/show_bug.go index 82d4160e..f9a30b4b 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -429,8 +429,9 @@ func (sb *showBug) renderSidebar(g *gocui.Gui, sideView *gocui.View) error { labelStr := make([]string, len(snap.Labels)) for i, l := range snap.Labels { - color256 := l.Term256() - labelStr[i] = fmt.Sprintf("\x1b[38;5;%dm◼\x1b[0m %s", color256, string(l)) + lc := l.Color() + lc256 := lc.Term256() + labelStr[i] = lc256.Escape() + "◼ " + lc256.Unescape() + l.String() } labels := strings.Join(labelStr, "\n") -- cgit