1package main 2 3import ( 4 "fmt" 5 "github.com/xyproto/vt100" 6) 7 8// This program demonstrates several different ways of outputting colored text 9// Use `./color | cat -v` to see the color codes that are used. 10 11func main() { 12 vt100.Blue.Output("This is in blue") 13 14 fmt.Println(vt100.BrightColor("hi", "Green")) 15 fmt.Println(vt100.BrightColor("done", "Blue")) 16 17 fmt.Println(vt100.Words("process: ERROR", "green", "red")) 18 19 vt100.LightYellow.Output("jk") 20 21 blue := vt100.BackgroundBlue.Get 22 green := vt100.LightGreen.Get 23 24 fmt.Printf("%s: %s\n", blue("status"), green("good")) 25 26 combined := vt100.Blue.Background().Combine(vt100.Yellow).Combine(vt100.Reverse) 27 combined.Output("DONE") 28} 29