Added ANSI colors
This commit is contained in:
parent
55da31ffd6
commit
929938dcd6
5 changed files with 135 additions and 1 deletions
2
Color.go
2
Color.go
|
@ -40,7 +40,7 @@ func (c Color) Print(args ...any) {
|
|||
fmt.Printf("\x1b[38;2;%d;%d;%dm%s\x1b[0m", byte(c.R*255), byte(c.G*255), byte(c.B*255), fmt.Sprint(args...))
|
||||
}
|
||||
|
||||
// Print writes the text in the given color to standard output.
|
||||
// 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 {
|
||||
fmt.Printf(format, args...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue