Skip to content

a-poor/golors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golors

Go Reference

created by Austin Poor

A tiny go package for printing colorful text to the terminal.

Functions wrap fmt.Print and fmt.Println for the following colors:

  • Red
  • Green
  • Yellow
  • Blue
  • Purple
  • Cyan
  • Gray
  • Grey (alias of Gray)
  • White

Example

package main

import "github.com/a-poor/golors"

func main() {
    // Print red text and a new-line character
    golors.Redln("This text is red!")
    
    // These three commands print a single line "whitecyanpurple"
    // but where each word is the correct color
    golors.White("white")
    golors.Cyan("cyan")
    golors.Purpleln("purple")
}

And the result is:

Screenshot of Sample Color Bash Output

ToDo

Include more colors, background colors, and text styles (ie bold, faint, italics, and underlined)

Reference article

About

A tiny golang package for formatting text in the terminal.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages