-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
theme.go
57 lines (51 loc) · 1.13 KB
/
theme.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
package main
import (
"github.com/muesli/termenv"
)
// Theme defines the colors used by gitty.
type Theme struct {
colorBlack string
colorRed string
colorYellow string
colorGreen string
colorBlue string
colorTooltip string
colorDarkGray string
colorGray string
colorMagenta string
colorCyan string
}
func defaultThemeName() string {
if !termenv.HasDarkBackground() {
return "light"
}
return "dark"
}
func initTheme() {
themes := make(map[string]Theme)
themes["dark"] = Theme{
colorBlack: "#222222",
colorRed: "#E88388",
colorYellow: "#DBAB79",
colorGreen: "#A8CC8C",
colorBlue: "#71BEF2",
colorDarkGray: "#888888",
colorTooltip: "#555555",
colorGray: "#B9BFCA",
colorMagenta: "#D290E4",
colorCyan: "#66C2CD",
}
themes["light"] = Theme{
colorBlack: "#eeeeee",
colorRed: "#D70000",
colorYellow: "#FFAF00",
colorGreen: "#005F00",
colorBlue: "#000087",
colorDarkGray: "#303030",
colorTooltip: "#303030",
colorGray: "#303030",
colorMagenta: "#AF00FF",
colorCyan: "#0087FF",
}
theme = themes[defaultThemeName()]
}