summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0704276..ddae96d 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,18 @@ cli.choose do |menu|
menu.choice(:ruby) { cli.say("Good choice!") }
menu.choices(:python, :perl) { cli.say("Not from around here, are you?") }
end
+
+## Using colored indices on Menus
+
+HighLine::Menu.index_color = :rgb_77bbff # set default index color
+
+cli.choose do |menu|
+ menu.index_color = :rgb_999999 # override default color of index
+ # you can also use constants like :blue
+ menu.prompt = "Please choose your favorite programming language? "
+ menu.choice(:ruby) { cli.say("Good choice!") }
+ menu.choices(:python, :perl) { cli.say("Not from around here, are you?") }
+end
```
If you want to save some characters, you can inject/import HighLine methods on Kernel by doing the following. Just be sure to avoid name collisions in the top-level namespace.