Added ANSI colors

This commit is contained in:
2024-03-11 23:28:37 +01:00
parent 6de4715030
commit 393a9ebf17
5 changed files with 135 additions and 1 deletions

View File

@ -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...)