-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.go
39 lines (33 loc) · 845 Bytes
/
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
package main
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)
type appTheme struct {
fyne.Theme
}
func newAppTheme() fyne.Theme {
return &appTheme{Theme: theme.DefaultTheme()}
}
const ColorNameOnPrimary = "OnPrimary"
func (t *appTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
switch name {
case theme.ColorNameHeaderBackground:
return t.Color(theme.ColorNamePrimary, variant)
case theme.ColorNamePrimary:
if variant == theme.VariantLight {
return color.RGBA{R: 0x00, G: 0x67, B: 0x7F, A: 255}
} else {
return color.RGBA{R: 0x7C, G: 0xD2, B: 0xF0, A: 255}
}
case ColorNameOnPrimary:
if variant == theme.VariantLight {
return color.White
} else {
return color.RGBA{R: 0x00, G: 0x35, B: 0x43, A: 255}
}
default:
return t.Theme.Color(name, variant)
}
}