Skip to content

Instantly share code, notes, and snippets.

@hackerzhut
Created May 2, 2019 11:55
Show Gist options
  • Save hackerzhut/8782246e39a75183140ffc1d65daf56c to your computer and use it in GitHub Desktop.
Save hackerzhut/8782246e39a75183140ffc1d65daf56c to your computer and use it in GitHub Desktop.
Color Console
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