summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAregic <aregic@gmail.com>2016-05-27 00:00:30 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2016-05-31 01:29:56 -0300
commit40c452c5571117b54edcea33caa9e52efff43a12 (patch)
tree5a8221fcf49958116a9ca069248357e392895369 /README.md
parent19a3e7f98a54173765dea9f51d1bace2f73ca271 (diff)
downloadhighline-40c452c5571117b54edcea33caa9e52efff43a12.tar.gz
Add doc for Menu's indices coloring
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.