The rich project allows to specify console markup, including text color. However it seems that any color choices need to be hardcoded, e.g. using red for important messages:
from rich import print
print('[red bold]This is a very important notification[/]')
This looks good on a terminal with light background color (e.g. Solarized light):
However when the user has a dark background color, it makes it difficult to read (e.g. Solarized dark):
As the developer of a command line application using rich, however, I cannot assume any background color for the users' terminals and hence hardcoding specific colors doesn't seem like a good idea (I don't want to modify the background color either, since the user probably chose it for a good reason). So I was wondering whether rich offers background-aware color choices (e.g. via themes, so I could just specify something like category='important')?



