mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-17 08:10:22 -07:00
Themes to map
This commit is contained in:
parent
a69c62fc9f
commit
70245a23f6
61
color.go
61
color.go
@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/gdamore/tcell/v2"
|
"github.com/gdamore/tcell/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type color_theme struct {
|
type palette struct {
|
||||||
bg tcell.Color
|
bg tcell.Color
|
||||||
fg tcell.Color
|
fg tcell.Color
|
||||||
gray tcell.Color
|
gray tcell.Color
|
||||||
@ -17,27 +17,30 @@ type color_theme struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Gruvbox color_theme = color_theme{
|
themes_name = []string{"Gruvbox", "Nord"}
|
||||||
bg: tcell.NewHexColor(0x282828),
|
Themes = map[string]palette{
|
||||||
fg: tcell.NewHexColor(0xebdbb2),
|
"Gruvbox": {
|
||||||
gray: tcell.NewHexColor(0x928374),
|
bg: tcell.NewHexColor(0x282828),
|
||||||
red: tcell.NewHexColor(0xfb4934),
|
fg: tcell.NewHexColor(0xebdbb2),
|
||||||
green: tcell.NewHexColor(0xfabd2f),
|
gray: tcell.NewHexColor(0x928374),
|
||||||
yellow: tcell.NewHexColor(0xfabd2f),
|
red: tcell.NewHexColor(0xfb4934),
|
||||||
blue: tcell.NewHexColor(0x83a598),
|
green: tcell.NewHexColor(0xfabd2f),
|
||||||
purple: tcell.NewHexColor(0xd3869b),
|
yellow: tcell.NewHexColor(0xfabd2f),
|
||||||
cyan: tcell.NewHexColor(0x8ec07c),
|
blue: tcell.NewHexColor(0x83a598),
|
||||||
}
|
purple: tcell.NewHexColor(0xd3869b),
|
||||||
Nord color_theme = color_theme{
|
cyan: tcell.NewHexColor(0x8ec07c),
|
||||||
bg: tcell.NewHexColor(0x3b4252),
|
},
|
||||||
fg: tcell.NewHexColor(0xeceff4),
|
"Nord": {
|
||||||
gray: tcell.NewHexColor(0x4c566a),
|
bg: tcell.NewHexColor(0x3b4252),
|
||||||
red: tcell.NewHexColor(0xbf616a),
|
fg: tcell.NewHexColor(0xeceff4),
|
||||||
green: tcell.NewHexColor(0xa3be8c),
|
gray: tcell.NewHexColor(0x4c566a),
|
||||||
yellow: tcell.NewHexColor(0xebcb8b),
|
red: tcell.NewHexColor(0xbf616a),
|
||||||
blue: tcell.NewHexColor(0x81a1c1),
|
green: tcell.NewHexColor(0xa3be8c),
|
||||||
purple: tcell.NewHexColor(0xb48ead),
|
yellow: tcell.NewHexColor(0xebcb8b),
|
||||||
cyan: tcell.NewHexColor(0x8fbcbb),
|
blue: tcell.NewHexColor(0x81a1c1),
|
||||||
|
purple: tcell.NewHexColor(0xb48ead),
|
||||||
|
cyan: tcell.NewHexColor(0x8fbcbb),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -55,11 +58,11 @@ type Window struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) color_init() {
|
func (w *Window) color_init() {
|
||||||
w.src.background_color = Gruvbox.bg
|
w.src.background_color = Themes["Gruvbox"].bg
|
||||||
w.src.border_color = Gruvbox.red
|
w.src.border_color = Themes["Gruvbox"].red
|
||||||
w.src.foreground_color = Gruvbox.fg
|
w.src.foreground_color = Themes["Gruvbox"].fg
|
||||||
w.src.selected_color = Gruvbox.gray
|
w.src.selected_color = Themes["Gruvbox"].gray
|
||||||
w.dest.background_color = Gruvbox.bg
|
w.dest.background_color = Themes["Gruvbox"].bg
|
||||||
w.dest.border_color = Gruvbox.blue
|
w.dest.border_color = Themes["Gruvbox"].blue
|
||||||
w.dest.foreground_color = Gruvbox.fg
|
w.dest.foreground_color = Themes["Gruvbox"].fg
|
||||||
}
|
}
|
||||||
|
2
ui.go
2
ui.go
@ -44,6 +44,8 @@ func InputHandle(event *tcell.EventKey) *tcell.EventKey {
|
|||||||
dest_box.SetText("PPP")
|
dest_box.SetText("PPP")
|
||||||
case tcell.KeyCtrlT:
|
case tcell.KeyCtrlT:
|
||||||
dest_box.SetText("TTT")
|
dest_box.SetText("TTT")
|
||||||
|
case tcell.KeyCtrlS:
|
||||||
|
dest_box.SetText("SSS")
|
||||||
}
|
}
|
||||||
|
|
||||||
return event
|
return event
|
||||||
|
Loading…
x
Reference in New Issue
Block a user