From c10cd1f770fab876acf3fa9fd7bda9b85d81d4a4 Mon Sep 17 00:00:00 2001 From: Emile Date: Thu, 31 Oct 2019 17:22:20 +0100 Subject: :art: color --- src/color.go | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/color.go (limited to 'src/color.go') diff --git a/src/color.go b/src/color.go new file mode 100644 index 0000000..adcd3f0 --- /dev/null +++ b/src/color.go @@ -0,0 +1,51 @@ +package main + +import "fmt" + +func red(text string) string { + return fmt.Sprintf("\033[0;31m%s\033[0m", text) +} + +func boldRed(text string) string { + return fmt.Sprintf("\033[1;31m%s\033[0m", text) +} + +func green(text string) string { + return fmt.Sprintf("\033[0;32m%s\033[0m", text) +} + +func boldGreen(text string) string { + return fmt.Sprintf("\033[1;32m%s\033[0m", text) +} + +func yellow(text string) string { + return fmt.Sprintf("\033[0;33m%s\033[0m", text) +} + +func boldYellow(text string) string { + return fmt.Sprintf("\033[1;33m%s\033[0m", text) +} + +func blue(text string) string { + return fmt.Sprintf("\033[0;34m%s\033[0m", text) +} + +func boldBlue(text string) string { + return fmt.Sprintf("\033[1;34m%s\033[0m", text) +} + +func magenta(text string) string { + return fmt.Sprintf("\033[0;35m%s\033[0m", text) +} + +func boldMagenta(text string) string { + return fmt.Sprintf("\033[1;35m%s\033[0m", text) +} + +func cyan(text string) string { + return fmt.Sprintf("\033[0;36m%s\033[0m", text) +} + +func boldCyan(text string) string { + return fmt.Sprintf("\033[1;36m%s\033[0m", text) +} -- cgit 1.4.1