-
Hi, how do I add these colored pixels/blocks like in the preview to my code. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
What do you mean colored pixel/blocks? Do you mean those in color palette? If yes then you can use RichRenderable object for that https://github.com/Textualize/rich/blob/master/rich/__main__.py#L18-L36 |
Beta Was this translation helpful? Give feedback.
-
Hey @UltraStudioLTD thank's for posting that reply. Using the half height pixel with a background is such a clever way to create a beautiful, compact, colors display! I was able to replicated in Term |
Beta Was this translation helpful? Give feedback.
What do you mean colored pixel/blocks? Do you mean those in color palette?
If yes then you can use RichRenderable object for that https://github.com/Textualize/rich/blob/master/rich/__main__.py#L18-L36
It is constructed by using ▄ (half-height pixel/cell) character and carefully setting it's foreground and background which creates 2 color in the same terminal cell