initial commit
This commit is contained in:
44
internal/ui/style/style.go
Normal file
44
internal/ui/style/style.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package style
|
||||
|
||||
import (
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
var (
|
||||
// main views
|
||||
FgColor = tview.Styles.PrimaryTextColor
|
||||
BgColor = tview.Styles.PrimitiveBackgroundColor
|
||||
BorderColor = tcell.ColorLightBlue
|
||||
MenuFgColor = tcell.ColorBlack
|
||||
MenuBgColor = tcell.ColorLightBlue
|
||||
HelpHeaderFgColor = tcell.ColorLightBlue
|
||||
PageHeaderBgColor = tcell.ColorPink
|
||||
PageHeaderFgColor = tview.Styles.PrimaryTextColor
|
||||
|
||||
// dialogs
|
||||
DialogBgColor = tcell.ColorLightBlue
|
||||
DialogFgColor = tcell.ColorBlack
|
||||
DialogBorderColor = tcell.ColorLightBlue
|
||||
DialogSubBoxBgColor = tcell.ColorWhite
|
||||
DialogSubBoxFgColor = tcell.ColorBlack
|
||||
DialogSubBoxBorderColor = tcell.ColorLightBlue
|
||||
ErrorDialogBgColor = tcell.ColorRed
|
||||
ErrorDialogButtonBgColor = tcell.ColorPink
|
||||
|
||||
// tables
|
||||
TableHeaderBgColor = tcell.ColorLightBlue
|
||||
TableHeaderFgColor = tcell.ColorBlack
|
||||
TableSelectedFgColor = tcell.ColorBlack
|
||||
TableSelectedBgColor = tcell.ColorWhite
|
||||
|
||||
// progressbar
|
||||
PrgBarColor = tcell.ColorGreen
|
||||
PrgBarBgColor = tcell.ColorDarkGreen
|
||||
|
||||
// other
|
||||
ButtonBgColor = tcell.ColorBlack
|
||||
ButtonFgColor = tcell.ColorLightBlue
|
||||
ButtonSelectedFgColor = tcell.ColorBlack
|
||||
ButtonSelectedBgColor = tcell.ColorWhite
|
||||
)
|
||||
14
internal/ui/style/utils.go
Normal file
14
internal/ui/style/utils.go
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package style
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gdamore/tcell/v2"
|
||||
)
|
||||
|
||||
func GetColorHex(color tcell.Color) string {
|
||||
return fmt.Sprintf("#%06x", color.Hex())
|
||||
}
|
||||
15
internal/ui/style/utils_windows.go
Normal file
15
internal/ui/style/utils_windows.go
Normal file
@@ -0,0 +1,15 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package style
|
||||
|
||||
import "github.com/gdamore/tcell/v2"
|
||||
|
||||
func GetColorHex(color tcell.Color) string {
|
||||
for name, c := range tcell.ColorNames {
|
||||
if c == color {
|
||||
return name
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
Reference in New Issue
Block a user