Added color names magenta, cyan, and yellow

This commit is contained in:
Celestino Amoroso 2024-02-25 07:02:01 +01:00
parent ccdd5c5cdb
commit 01ec36c7b6

7
tty.go
View File

@ -26,12 +26,18 @@ func translateColor(name string) (c int) {
c = 30
case strings.HasPrefix("blue", norm):
c = 34
case strings.HasPrefix("cyan", norm):
c = 36
case strings.HasPrefix("green", norm):
c = 32
case strings.HasPrefix("magenta", norm):
c = 35
case strings.HasPrefix("red", norm):
c = 31
case strings.HasPrefix("white", norm):
c = 37
case strings.HasPrefix("yellow", norm):
c = 33
default:
c = -1
}
@ -273,7 +279,6 @@ func Printf(templ string, args ...any) (int, error) {
func Fprintf(w io.Writer, templ string, args ...any) (int, error) {
templ, _, _ = ToTtyStream(w, templ)
return fmt.Fprintf(w, templ, args...)
}
// func DebugSprintf() {