Skip to content
hpcloudPublic

About

Go terminal color package (256 colors)

Resources

Stars

16 stars

Watchers

46 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

16 stars

Watchers

46 watching

Forks

Releases

Packages

Contributors

Languages