2016-11-01 09:56:12 +00:00
|
|
|
package settings
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/fatih/color"
|
|
|
|
)
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Colors allowed
|
2016-11-01 09:56:12 +00:00
|
|
|
type Colors struct {
|
|
|
|
Red
|
|
|
|
Blue
|
|
|
|
Yellow
|
|
|
|
Magenta
|
|
|
|
Green
|
|
|
|
}
|
2016-12-17 10:43:27 +00:00
|
|
|
// Red color
|
2016-11-01 09:56:12 +00:00
|
|
|
type Red struct{}
|
2016-12-17 10:43:27 +00:00
|
|
|
// Blue color
|
2016-11-01 09:56:12 +00:00
|
|
|
type Blue struct{}
|
2016-12-17 10:43:27 +00:00
|
|
|
// Yellow color
|
2016-11-01 09:56:12 +00:00
|
|
|
type Yellow struct{}
|
2016-12-17 10:43:27 +00:00
|
|
|
// Magenta color
|
2016-11-01 09:56:12 +00:00
|
|
|
type Magenta struct{}
|
2016-12-17 10:43:27 +00:00
|
|
|
// Green color
|
2016-11-01 09:56:12 +00:00
|
|
|
type Green struct{}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Regular font in red
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Red) Regular(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgRed).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Bold font in red
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Red) Bold(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgRed, color.Bold).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Regular font in blue
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Blue) Regular(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgBlue).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Bold font in blue
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Blue) Bold(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgBlue, color.Bold).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Regular font in yellow
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Yellow) Regular(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgYellow).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Bold font in red
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Yellow) Bold(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgYellow, color.Bold).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Regular font in magenta
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Magenta) Regular(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgMagenta).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Bold font in magenta
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Magenta) Bold(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgMagenta, color.Bold).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Regular font in green
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Green) Regular(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgGreen).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|
|
|
|
|
2016-12-17 10:43:27 +00:00
|
|
|
// Bold font in red
|
2016-11-01 09:56:12 +00:00
|
|
|
func (c Green) Bold(t ...interface{}) string {
|
|
|
|
r := color.New(color.FgGreen, color.Bold).SprintFunc()
|
|
|
|
return r(t...)
|
|
|
|
}
|