realize/style/style.go
2017-04-15 23:55:24 +09:00

25 lines
516 B
Go

package style
import (
"github.com/fatih/color"
)
type colorBase color.Attribute
func (s colorBase) Regular(a ...interface{}) string {
return color.New(color.Attribute(s)).Sprint(a...)
}
func (s colorBase) Bold(a ...interface{}) string {
return color.New(color.Attribute(s), color.Bold).Sprint(a...)
}
// allowed colors
var (
Red = colorBase(color.FgRed)
Blue = colorBase(color.FgBlue)
Yellow = colorBase(color.FgYellow)
Magenta = colorBase(color.FgMagenta)
Green = colorBase(color.FgGreen)
)