You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really enjoy using this library to work on some terminal projects.
Would it be possible to have a user set a color for a particular widget with a config file? I haven't had much luck trying to implement a user-configurable color for one of my projects. I am using a yaml config file. Would this be possible to implement?
The text was updated successfully, but these errors were encountered:
Sure it should be doable - the procedure I'd recommend is this: in your program create a mapping of color strings to py_cui.COLOR combinations, i.e. "blue" would map to py_cui.BLUE_ON_BLACK, assuming you want a black background. Then, load the yaml file, and set the widget color based on that, using widget.set_color(color_map[yaml_value]) right after initialization, where color_map maps the strings in the yaml file to py_cui values, and yaml_value is the assigned color from the yaml file. You would also need some way to know which widget is assigned which color, so you'd need another field in the yaml file that specifies the current widget.
Hope that steers you in the right direction, glad you enjoy the library!
Hey there,
I really enjoy using this library to work on some terminal projects.
Would it be possible to have a user set a color for a particular widget with a config file? I haven't had much luck trying to implement a user-configurable color for one of my projects. I am using a yaml config file. Would this be possible to implement?
The text was updated successfully, but these errors were encountered: