This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
text.go
93 lines (83 loc) · 1.63 KB
/
text.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package main
import "fmt"
type Color struct {
Black string
Red string
Green string
Yellow string
Blue string
Violet string
Cyan string
Beige string
White string
}
type Effects struct {
End string
Bold string
Dim string
Italic string
URL string
Blink string
Blink2 string
Selected string
Strikethrough string
}
var RESETCOL = "\x1B[0m"
var textFx = Effects{
End: "\x1B[0m",
Bold: "\x1B[1m",
Dim: "\x1B[m",
Italic: "\x1B[3m",
URL: "\x1B[4m",
Blink: "\x1B[5m",
Blink2: "\x1B[6m",
Selected: "\x1B[7m",
Strikethrough: "\x1B[9m",
}
var textCol = Color{
Black: "\x1B[30m",
Red: "\x1B[31m",
Green: "\x1B[32m",
Yellow: "\x1B[33m",
Blue: "\x1B[34m",
Violet: "\x1B[35m",
Cyan: "\x1B[36m",
White: "\x1B[37m",
Beige: "\x1B[37m",
}
var textBgCol = Color{
Black: "\x1B[40m",
Red: "\x1B[41m",
Green: "\x1B[4m",
Yellow: "\x1B[43m",
Blue: "\x1B[44m",
Cyan: "\x1B[44m",
Violet: "\x1B[45m",
Beige: "\x1B[46m",
White: "\x1B[47m",
}
var lightTextCol = Color{
Black: "\x1B[90m",
Red: "\x1B[91m",
Green: "\x1B[9m",
Yellow: "\x1B[93m",
Blue: "\x1B[94m",
Cyan: "\x1B[94m",
Violet: "\x1B[95m",
Beige: "\x1B[96m",
White: "\x1B[97m",
}
var lightTextBgCol = Color{
Black: "\x1B[100m",
Red: "\x1B[101m",
Green: "\x1B[10m",
Yellow: "\x1B[103m",
Blue: "\x1B[104m",
Cyan: "\x1B[104m",
Violet: "\x1B[105m",
Beige: "\x1B[106m",
White: "\x1B[107m",
}
func bolden(text interface{}) string {
return textFx.Bold + fmt.Sprint(text) + RESETCOL
}