Merge pull request #457 from zdenek-crha/bright_terminal_readability

Bright terminal readability
This commit is contained in:
Michael Muré 2020-09-27 13:35:06 +02:00 committed by GitHub
commit ae0529e3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -166,7 +166,7 @@ func showDefaultFormatter(env *Env, snapshot *bug.Snapshot) error {
)
if comment.Message == "" {
message = colors.GreyBold("No description provided.")
message = colors.BlackBold(colors.WhiteBg("No description provided."))
} else {
message = comment.Message
}

View File

@ -17,13 +17,13 @@ type helpBar []struct {
func (hb helpBar) Render(maxX int) string {
var builder strings.Builder
for _, entry := range hb {
builder.WriteString(colors.BlueBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text)))
builder.WriteString(colors.White(colors.BlueBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text))))
builder.WriteByte(' ')
}
l := text.Len(builder.String())
if l < maxX {
builder.WriteString(colors.BlueBg(strings.Repeat(" ", maxX-l)))
builder.WriteString(colors.White(colors.BlueBg(strings.Repeat(" ", maxX-l))))
}
return builder.String()

View File

@ -378,7 +378,7 @@ func (sb *showBug) renderMain(g *gocui.Gui, mainView *gocui.View) error {
// emptyMessagePlaceholder return a formatted placeholder for an empty message
func emptyMessagePlaceholder() string {
return colors.GreyBold("No description provided.")
return colors.BlackBold(colors.WhiteBg("No description provided."))
}
func (sb *showBug) createOpView(g *gocui.Gui, name string, x0 int, y0 int, maxX int, height int, selectable bool) (*gocui.View, error) {

View File

@ -5,15 +5,16 @@ import "github.com/fatih/color"
var (
Bold = color.New(color.Bold).SprintFunc()
Black = color.New(color.FgBlack).SprintFunc()
BlackBold = color.New(color.FgBlack, color.Bold).SprintfFunc()
BlackBg = color.New(color.BgBlack, color.FgWhite).SprintFunc()
White = color.New(color.FgWhite).SprintFunc()
WhiteBold = color.New(color.FgWhite, color.Bold).SprintFunc()
WhiteBg = color.New(color.BgWhite).SprintFunc()
Yellow = color.New(color.FgYellow).SprintFunc()
YellowBold = color.New(color.FgYellow, color.Bold).SprintFunc()
YellowBg = color.New(color.BgYellow, color.FgBlack).SprintFunc()
Green = color.New(color.FgGreen).SprintFunc()
GreenBg = color.New(color.BgGreen, color.FgBlack).SprintFunc()
GreyBold = color.New(color.BgBlack, color.Bold).SprintfFunc()
Red = color.New(color.FgRed).SprintFunc()
Cyan = color.New(color.FgCyan).SprintFunc()
CyanBg = color.New(color.BgCyan, color.FgBlack).SprintFunc()