wtpython icon indicating copy to clipboard operation
wtpython copied to clipboard

Setup Rich Styles for output formatting

Open briancohan opened this issue 4 years ago • 1 comments

We should try to create styles like the following to make things a bit more consistent across the application

from rich.console import Console
from rich.theme import Theme
custom_theme = Theme({
    "info" : "dim cyan",
    "warning": "magenta",
    "danger": "bold red"
})
console = Console(theme=custom_theme)
console.print("This is information", style="info")
console.print("[warning]The pod bay doors are locked[/warning]")
console.print("Something terrible happened!", style="danger")

https://rich.readthedocs.io/en/stable/style.html

briancohan avatar Aug 16 '21 00:08 briancohan

Does this also sync with the colours textual uses?

mustafaquraish avatar Aug 16 '21 06:08 mustafaquraish