Overview

Rich 13.0, released on December 30, 2022, overhauls the rendering engine and improves the styling system.

Main Features

Overhauled rendering engine

The rendering engine is optimized for large text volumes and better supports terminals with different capabilities.

python
from rich.console import Console
from rich.text import Text

console = Console()
text = Text('Hello Rich 13!')
text.stylize('bold magenta', 6, 14)
console.print(text)

Improved styling

The styling system supports gradients, custom colors, and more flexible style inheritance.

python
from rich.console import Console
from rich.theme import Theme

theme = Theme({
    'info': 'dim cyan',
    'warning': 'bold yellow',
    'error': 'bold red',
})

console = Console(theme=theme)
console.print('[info]Info[/] [warning]Warning[/] [error]Error[/]')

Sources