1
0
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:
Chris Cummer
2018-05-14 20:45:18 -07:00
parent 0d3b663642
commit 0ff65bbd5c
3 changed files with 13 additions and 22 deletions

View File

@@ -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 {