Skip to content

hpcloud/golor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golor

golor is a terminal color package for Go, supporting both 16-colors mode and 256 colors mode.

Example usage

16-bit color printing:

// See examples/colors.go
fmt.Println(golor.Colorize("Green foreground", golor.G, -1))
fmt.Println(golor.Colorize("Cyan background", -1, golor.CYAN))

256-color printing:

// See examples/colors.go
index := 42  // index can vary from 0 to 255
fmt.Println(golor.Colorize("Foreground", index, -1))

Consistently assigning unique colors to strings:

// See examples/unique.go
name := "srid"
fmt.Println(golor.Colorize(process, golor.AssignColor(name), -1))

About

Go terminal color package (256 colors)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages