forked from Licoy/fetch-github-hosts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui_theme.go
48 lines (42 loc) · 1.27 KB
/
gui_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
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
"image/color"
)
type fghGuiTheme struct {
}
func (f *fghGuiTheme) Font(s fyne.TextStyle) fyne.Resource {
font, err := assetsFs.ReadFile("assets/" + GuiFontName)
if err != nil {
return theme.DefaultTheme().Font(s)
}
return fyne.NewStaticResource("fgh-font", font)
}
func (*fghGuiTheme) Color(c fyne.ThemeColorName, _ fyne.ThemeVariant) color.Color {
switch c {
case theme.ColorNamePrimary, theme.ColorNameButton:
//#009966
return color.RGBA{G: 0x99, B: 0x66, A: 0xff}
case theme.ColorNameBackground:
//#191b2c
return color.RGBA{R: 0x19, G: 0x1b, B: 0x2c, A: 0xff}
case theme.ColorNameMenuBackground, theme.ColorNameInputBackground, theme.ColorNameOverlayBackground:
//#1f2437
return color.RGBA{R: 0x1f, G: 0x24, B: 0x37, A: 0xff}
case theme.ColorNameDisabledButton:
//#629181
return color.RGBA{R: 0x62, G: 0x91, B: 0x81, A: 0xff}
case theme.ColorNameDisabled:
//#34364a
return color.RGBA{R: 0x34, G: 0x36, B: 0x4a, A: 0xff}
default:
return theme.DefaultTheme().Color(c, theme.VariantDark)
}
}
func (*fghGuiTheme) Icon(n fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(n)
}
func (*fghGuiTheme) Size(n fyne.ThemeSizeName) float32 {
return theme.DefaultTheme().Size(n)
}