golor is a terminal color package for Go, supporting both 16-colors mode and 256 colors mode.
16-bit color printing:
// See examples/colors.gofmt.Println(golor.Colorize("Green foreground", golor.G, -1))
fmt.Println(golor.Colorize("Cyan background", -1, golor.CYAN))256-color printing:
// See examples/colors.goindex:=42// index can vary from 0 to 255fmt.Println(golor.Colorize("Foreground", index, -1))Consistently assigning unique colors to strings:
// See examples/unique.goname:="srid"fmt.Println(golor.Colorize(process, golor.AssignColor(name), -1))