piotrmurach / tty-prompt

A beautiful and powerful interactive command line prompt
https://ttytoolkit.org
MIT License
1.47k stars 136 forks source link

Apply `color` option for asking question #21

Closed namiwang closed 8 years ago

namiwang commented 8 years ago

I'd like to help with a PR, though minor directions like just add method foo to class Foo would be helpful.

piotrmurach commented 8 years ago

Hi Nano,

Thanks for using the library! Could you please elaborate on what you trying to achieve, any code examples would be welcome. I'm would like to see what do you want to color exactly?

For example, if I were to ask question that i want to be coloured blue I would do the following:

pastel = Pastel.new # you can use any colouring library really, but I'm using mine here ;-)
prompt = TTY::Prompt.new
prompt.ask(pastel.blue("I'm a blue question?"))
namiwang commented 8 years ago

Ah, totally missed that pastel repo, I just saw a color option lying right there for say yet no such corresponding for ask. Should have dug in.

Thanks for this great toolkit! Closing this.

piotrmurach commented 8 years ago

pastel is a dependency for this library so it will be installed anyways, but if you require some true colours then you can easily do that with another library.