How can I identify styles being used? #1564
-
Is there a way to identify the style being used? I noticed that time strings are in bright green and for me it's quite hard to read. I checked |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
SpoilerFound the solution while I wrote this answer. It is from rich.theme import Theme
from rich.console import Console
console = Console(theme=Theme({"repr.ipv6": "red italic on yellow"}))
console.print("12:34:45") My digging around before finding the solutionAfter digging around in the source code and learning about Style and Theme and Color classes, it seems to me as if this string is some kind of special case: At least I found out that the used color is green (not cyan, which is the color for log.time). I found out that the only colors that a string like this reacts to is the background color: which, for my understanding is caused by syntax highlighting, see the following example:
What does work, anyways, is the following:
|
Beta Was this translation helpful? Give feedback.
Spoiler
Found the solution while I wrote this answer. It is
repr.ipv6
, try the following:My digging around before finding the solution
After digging around in the source code and learning about Style and Theme and Color classes, it seems to me as if this string is some kind of special case:
At least I found out that the used color is green (not cyan, which is the color for log.time).
I found out that the only colors that a string like this reacts to is the background color:
which, for my understanding is caused by syntax highlig…