Added ANSI colors for old terminals
This commit is contained in:
6
Color.go
6
Color.go
@ -13,7 +13,7 @@ type Color struct {
|
||||
|
||||
// Print writes the text in the given color to standard output.
|
||||
func (c Color) Print(args ...any) {
|
||||
if !Terminal {
|
||||
if !Terminal || !TrueColor {
|
||||
fmt.Print(args...)
|
||||
return
|
||||
}
|
||||
@ -23,7 +23,7 @@ func (c Color) Print(args ...any) {
|
||||
|
||||
// Printf formats according to a format specifier and writes the text in the given color to standard output.
|
||||
func (c Color) Printf(format string, args ...any) {
|
||||
if !Terminal {
|
||||
if !Terminal || !TrueColor {
|
||||
fmt.Printf(format, args...)
|
||||
return
|
||||
}
|
||||
@ -33,7 +33,7 @@ func (c Color) Printf(format string, args ...any) {
|
||||
|
||||
// Println writes the text in the given color to standard output and appends a newline.
|
||||
func (c Color) Println(args ...any) {
|
||||
if !Terminal {
|
||||
if !Terminal || !TrueColor {
|
||||
fmt.Println(args...)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user