-
Notifications
You must be signed in to change notification settings - Fork 1
/
Color.go
40 lines (32 loc) · 948 Bytes
/
Color.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package sugar
import (
"fmt"
"github.com/mgutz/ansi"
)
var (
green = ansi.ColorCode("green")
yellow = ansi.ColorCode("yellow")
red = ansi.ColorCode("red")
cyan = ansi.ColorCode("cyan")
gray = ansi.LightBlack
grayUnderline = ansi.ColorCode("180+u")
reset = ansi.ColorCode("reset")
)
func greenColor(input interface{}) string {
return fmt.Sprintf("%s%+v%s", green, input, reset)
}
func redColor(input interface{}) string {
return fmt.Sprintf("%s%+v%s", red, input, reset)
}
func yellowColor(input interface{}) string {
return fmt.Sprintf("%s%+v%s", yellow, input, reset)
}
func cyanColor(input interface{}) string {
return fmt.Sprintf("%s%+v%s", cyan, input, reset)
}
func grayColor(input interface{}) string {
return fmt.Sprintf("%s%+v%s", gray, input, reset)
}
func grayUnderlineColor(input interface{}) string {
return fmt.Sprintf("%s%+v%s", grayUnderline, input, reset)
}