mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Row color as common function
This commit is contained in:
11
wtf/utils.go
11
wtf/utils.go
@@ -103,6 +103,17 @@ func RightAlignFormat(view *tview.TextView) string {
|
||||
return fmt.Sprintf("%%%ds", w-1)
|
||||
}
|
||||
|
||||
func RowColor(module string, idx int) string {
|
||||
evenKey := fmt.Sprintf("wtf.mods.%s.colors.row.even", module)
|
||||
oddKey := fmt.Sprintf("wtf.mods.%s.colors.row.odd", module)
|
||||
|
||||
if idx%2 == 0 {
|
||||
return Config.UString(evenKey, "white")
|
||||
} else {
|
||||
return Config.UString(oddKey, "lightblue")
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------- Slice Conversion -------------------- */
|
||||
|
||||
func ToInts(slice []interface{}) []int {
|
||||
|
||||
Reference in New Issue
Block a user