|
@@ -19,7 +19,7 @@ type Menu struct {
|
|
|
Panel
|
|
|
}
|
|
|
|
|
|
-func MakeMenuRender(c1, c2, c3, c4 string) func(string) string {
|
|
|
+func MakeMenuRender(bracketColor, optionColor, upperColor, lowerColor string) func(string) string {
|
|
|
f := func(text string) string {
|
|
|
var output string
|
|
|
var lastColor string
|
|
@@ -27,30 +27,30 @@ func MakeMenuRender(c1, c2, c3, c4 string) func(string) string {
|
|
|
for _, c := range text {
|
|
|
if option {
|
|
|
if c == '[' || c == ']' {
|
|
|
- if lastColor != c1 {
|
|
|
- output += c1
|
|
|
- lastColor = c1
|
|
|
+ if lastColor != bracketColor {
|
|
|
+ output += bracketColor
|
|
|
+ lastColor = bracketColor
|
|
|
}
|
|
|
output += string(c)
|
|
|
option = (c == '[')
|
|
|
} else {
|
|
|
- if lastColor != c2 {
|
|
|
- output += c2
|
|
|
- lastColor = c2
|
|
|
+ if lastColor != optionColor {
|
|
|
+ output += optionColor
|
|
|
+ lastColor = optionColor
|
|
|
}
|
|
|
output += string(c)
|
|
|
}
|
|
|
} else {
|
|
|
if unicode.IsUpper(c) {
|
|
|
- if lastColor != c3 {
|
|
|
- output += c3
|
|
|
- lastColor = c3
|
|
|
+ if lastColor != upperColor {
|
|
|
+ output += upperColor
|
|
|
+ lastColor = upperColor
|
|
|
}
|
|
|
output += string(c)
|
|
|
} else {
|
|
|
- if lastColor != c4 {
|
|
|
- output += c4
|
|
|
- lastColor = c4
|
|
|
+ if lastColor != lowerColor {
|
|
|
+ output += lowerColor
|
|
|
+ lastColor = lowerColor
|
|
|
}
|
|
|
output += string(c)
|
|
|
}
|