PyInquirer icon indicating copy to clipboard operation
PyInquirer copied to clipboard

Updated colors in color_print.py

Open AlexIchenskiy opened this issue 4 years ago • 3 comments

Added colors from the TODO list using _print_token_factory

AlexIchenskiy avatar Feb 16 '21 19:02 AlexIchenskiy

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

7eith avatar Apr 29 '21 05:04 7eith

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.

AlexIchenskiy avatar Apr 29 '21 13:04 AlexIchenskiy

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

7eith avatar Apr 30 '21 06:04 7eith