-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.go
More file actions
83 lines (74 loc) · 1.42 KB
/
style.go
File metadata and controls
83 lines (74 loc) · 1.42 KB
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
package console
type Alignment uint8
const (
Left = iota
Right
Center
)
type Color uint8
const (
// Use no color but the default
None = iota
Black
Red
Green
Yellow
Blue
Magenta
Cyan
LightGray
Gray
BrightRed
BrightGreen
BrightYellow
BrightBlue
BrightMagenta
BrightCyan
White
)
type Stylesheet struct {
Alignment Alignment
Width int
Margin [2]int
Sequence [8]Cell
}
type color_key struct {
Bg bool
Color Color
}
var color_codes = map[color_key]uint8{
{false, None}: 0,
{true, None}: 0,
{false, Black}: 30,
{false, Red}: 31,
{false, Green}: 32,
{false, Yellow}: 33,
{false, Blue}: 34,
{false, Magenta}: 35,
{false, Cyan}: 36,
{false, LightGray}: 37,
{false, Gray}: 90,
{false, BrightRed}: 91,
{false, BrightGreen}: 92,
{false, BrightYellow}: 93,
{false, BrightBlue}: 94,
{false, BrightMagenta}: 95,
{false, BrightCyan}: 96,
{false, White}: 97,
{true, Black}: 40,
{true, Red}: 41,
{true, Green}: 42,
{true, Yellow}: 43,
{true, Blue}: 44,
{true, Magenta}: 45,
{true, Cyan}: 46,
{true, LightGray}: 47,
{true, Gray}: 100,
{true, BrightRed}: 101,
{true, BrightGreen}: 102,
{true, BrightYellow}: 103,
{true, BrightBlue}: 104,
{true, BrightMagenta}: 105,
{true, BrightCyan}: 106,
{true, White}: 107,
}