1package main 2 3import ( 4 "fmt" 5 "github.com/xyproto/textoutput" 6) 7 8func main() { 9 // Enable colors, enable output 10 o := textoutput.New() 11 12 // Output "a" in light blue and "b" in light green 13 fmt.Println(o.LightTags("<blue>", "a", "<off> <green>", "b", "<off>")) 14 15 // Output "a" in light blue and "b c" in light green 16 fmt.Println(o.Words("a b c", "blue", "green")) 17 18 // Output "a b c" in light cyan 19 o.OutputWords("a b c", "lightcyan") 20 21 // Output "a" in light blue and "b" in light green 22 fmt.Println(o.LightBlue("a") + " " + o.LightGreen("b")) 23 24 // Output "c" in dark blue and "d" in light yellow 25 fmt.Println(o.DarkTags("<blue>c</blue> <lightyellow>d<off>")) 26 27 // Output "a" in light yellow 28 fmt.Println(o.LightTags("<yellow>", "a", "</yellow>")) 29 30 // Output "a" in dark red 31 fmt.Println(o.Tags("<darkred>a</darkred>")) 32 33 // Output "a" in dark gray 34 o.OutputTags("<darkgray>a<off>") 35 36 // Exit with a dark red error message 37 //o.ErrExit("MALFUNCTION: textual output too convenient!") 38} 39