2017-10-08 21:09:45 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/fatih/color"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
output = color.Output
|
2017-11-08 14:53:09 +00:00
|
|
|
red = colorBase(color.FgHiRed)
|
|
|
|
blue = colorBase(color.FgHiBlue)
|
|
|
|
green = colorBase(color.FgHiGreen)
|
|
|
|
yellow = colorBase(color.FgHiYellow)
|
|
|
|
magenta = colorBase(color.FgHiMagenta)
|
2017-10-08 21:09:45 +00:00
|
|
|
)
|
|
|
|
|
2017-11-20 08:18:18 +00:00
|
|
|
// ColorBase type
|
2017-10-08 21:09:45 +00:00
|
|
|
type colorBase color.Attribute
|
|
|
|
|
2017-11-20 08:18:18 +00:00
|
|
|
// Regular font with a color
|
2017-10-08 21:09:45 +00:00
|
|
|
func (c colorBase) regular(a ...interface{}) string {
|
|
|
|
return color.New(color.Attribute(c)).Sprint(a...)
|
|
|
|
}
|
|
|
|
|
2017-11-20 08:18:18 +00:00
|
|
|
// Bold font with a color
|
2017-10-08 21:09:45 +00:00
|
|
|
func (c colorBase) bold(a ...interface{}) string {
|
|
|
|
return color.New(color.Attribute(c), color.Bold).Sprint(a...)
|
|
|
|
}
|