Skip to content

Commit

Permalink
Merge pull request #17 from Ortiye/master
Browse files Browse the repository at this point in the history
Fix colors
  • Loading branch information
Yash-Handa committed Dec 28, 2020
2 parents c32decf + 77afdeb commit f05b146
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions internal/ctw/ctw.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ func (w *CTW) printCell(buf *bytes.Buffer, i int, cs [4]int) {
fmt.Fprintf(buf, "%-*s%s", cs[0]-1, w.d[i][0], brailEmpty)
}
if w.showIcon {
fmt.Fprintf(buf, "%s%1s%s%s", w.ic[i], w.d[i][1], white, brailEmpty)
fmt.Fprintf(buf, "%s%1s%s%s", w.ic[i], w.d[i][1], noColor, brailEmpty)
}
fmt.Fprintf(buf, "%s%-*s%s", getGitColor(w.d[i][3]), cs[2], w.d[i][2], white)
fmt.Fprintf(buf, "%s%-*s%s", getGitColor(w.d[i][3]), cs[2], w.d[i][2], noColor)

if cs[3] > 0 {
fmt.Fprintf(buf, "%s%s%1s%s", brailEmpty, getGitColor(w.d[i][3]), w.d[i][3], white)
fmt.Fprintf(buf, "%s%s%1s%s", brailEmpty, getGitColor(w.d[i][3]), w.d[i][3], noColor)
}
}
4 changes: 2 additions & 2 deletions internal/ctw/longCtw.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func (l *LongCTW) Flush(buf *bytes.Buffer) {
}

if j == l.cols-2 {
fmt.Fprintf(buf, "%s%*s%s", l.ic[i], l.c[j], c, white)
fmt.Fprintf(buf, "%s%*s%s", l.ic[i], l.c[j], c, noColor)
} else if j >= l.cols-1 && (1<<l.cols)&skipCol == 0 {
color := getGitColor(r[l.cols])
fmt.Fprintf(buf, "%s%-*s%s", color, l.c[j], c, white)
fmt.Fprintf(buf, "%s%-*s%s", color, l.c[j], c, noColor)
} else {
fmt.Fprintf(buf, "%-*s", l.c[j], c)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/ctw/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package ctw
import "strings"

var (
white string = "\033[38;2;255;255;255m"
noColor string = "\033[0m"
green string = "\033[38;2;055;183;021m"
brown string = "\033[38;2;192;154;107m"
brailEmpty string = "\u2800"
)

func DisplayColor(b bool) {
if b == false {
white = ""
noColor = ""
green = ""
brown = ""
}
Expand All @@ -26,7 +26,7 @@ func DisplayBrailEmpty(b bool) {
func getGitColor(gitStatus string) string {
switch strings.Trim(gitStatus, " ") {
case "":
return white
return noColor
case "U":
return green
default:
Expand Down

0 comments on commit f05b146

Please sign in to comment.