CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.91k stars 235 forks source link

Updated colors in color_print.py #154

Open AlexIchenskiy opened 3 years ago

AlexIchenskiy commented 3 years ago

Added colors from the TODO list using _print_token_factory

7eith commented 3 years ago

Hi, do you know how to use it (color) on a RawList or a List?

AlexIchenskiy commented 3 years ago

Hi, do you know how to use it (color) on a RawList or a List?

Hey, try using style_from_dict to create style sheet and then apply it when you propmt your list like this:

`custom_style_1 = style_from_dict({ "separator": '#cc5454', "questionmark": '#673ab7 bold', "selected": '#cc5454', # default "pointer": '#673ab7 bold', "instruction": '', # default "answer": '#f44336 bold', "question": '', })

Your code here

answers = prompt.prompt(your_list, style=custom_style_2) pprint(answers)`

You can also check examples folder, all styles are stored in the init.py file.

7eith commented 3 years ago

Yes thank's you,do you know if it is possible to print a different color for each choices in rawlist/checkbox ?