Added white (for the grays) calendar color

This commit is contained in:
Brian Buller 2017-04-14 16:29:07 -05:00
parent 649314bb4d
commit 7800febdc5

View File

@ -446,7 +446,7 @@ func CalColToAnsi(col calendar.ColorDefinition) *color.Color {
colRed := 4 colRed := 4
colMagenta := 5 colMagenta := 5
colYellow := 6 colYellow := 6
//colWhite := 7 colWhite := 7
var hexToAnsi = func(hex string) (int, error) { var hexToAnsi = func(hex string) (int, error) {
switch strings.ToLower(hex) { switch strings.ToLower(hex) {
@ -460,6 +460,8 @@ func CalColToAnsi(col calendar.ColorDefinition) *color.Color {
return colRed, nil return colRed, nil
case "#fad165", "#ff7537", "#e6c800", "#fbe983", "#ffad46": case "#fad165", "#ff7537", "#e6c800", "#fbe983", "#ffad46":
return colYellow, nil return colYellow, nil
case "#c2c2c2":
return colWhite, nil
} }
return 0, errors.New("Not found") return 0, errors.New("Not found")
} }
@ -500,6 +502,8 @@ func CalColToAnsi(col calendar.ColorDefinition) *color.Color {
ret.Add(color.BgMagenta) ret.Add(color.BgMagenta)
case colYellow: case colYellow:
ret.Add(color.BgYellow) ret.Add(color.BgYellow)
case colWhite:
ret.Add(color.BgWhite)
} }
} }