diff options
author | Aregic <aregic@gmail.com> | 2016-05-27 00:00:30 -0300 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2016-05-31 01:29:56 -0300 |
commit | 40c452c5571117b54edcea33caa9e52efff43a12 (patch) | |
tree | 5a8221fcf49958116a9ca069248357e392895369 /README.md | |
parent | 19a3e7f98a54173765dea9f51d1bace2f73ca271 (diff) | |
download | highline-40c452c5571117b54edcea33caa9e52efff43a12.tar.gz |
Add doc for Menu's indices coloring
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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. |