Created
May 2, 2019 11:55
-
-
Save hackerzhut/8782246e39a75183140ffc1d65daf56c to your computer and use it in GitHub Desktop.
Color Console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package console | |
import "fmt" | |
const ( | |
TextBlack = iota + 30 | |
TextRed | |
TextGreen | |
TextYellow | |
TextBlue | |
TextMagenta | |
TextCyan | |
TextWhite | |
) | |
func ColorfulText(color int, text string) string { | |
return fmt.Sprintf("\x1b[0;%dm%s\x1b[0m", color, text) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment