Skip to content

eklownr/pretty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

pretty

Pretty colors for the terminal.

Install:

go get github.com/eklownr/pretty
// replacement for fmt.Printf(string, multiple values). 
func Pl(s string, value ...interface{}) string {
	return Colorize(fmt.Sprintf(s+"\n", value...))
}

// colorize: text=Cyan, numbers=Green, special char and error=Red
func Colorize(text string) string {
  ...
}

// print string in one color
func PrintColor(text string, color string) {
	switch color {
	case "red":
		fmt.Printf("\033[31m%s\033[0m\n", text)
	case "green":
    ...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages