Open epistoteles opened 2 weeks ago
That methods creates reprs, which are intended to be formatted like a Python expression. It won't produce any escape sequences.
Why do you want to print a ColorTriplet? It was only intended for the Color class, which already generates the actual color if you print it.
When I print a rich ColorTriplet, I don't just want to see the values for red, green, and blue in my console. I also want to see the color.
I tried giving the ColorTriplet a new
__rich_repr__
on the fly which also includes a small color swatch in its color.However, the resulting console output looks like this:
where
'██'
just gets displayed in the default green string color.Can rich renderables not be used inside a
__rich_repr__
?