console.save_html -> Colors #946
Replies: 3 comments
-
By the way I realize that I can change the color by styling the text first, printing it and then exporting to HTML, but I would like to know if in general there's an easier way to determine the final look of the HTML. |
Beta Was this translation helpful? Give feedback.
-
Hi Federico, The TerminalTheme defines the default foreground/background and the first 16 colors because those are generally set by the terminal, and Rich needs to know what they are when exporting html. For the other colors Rich will try to faithfully reproduce what you see on the terminal. I'm guessing your black text was the default color? Setting foreground in the theme should change that. Other than the first 16 colors there's no way to modify the colors at the point of export. You would need to modify the colors you are printing. I guess you have found the theme system which is the best way to do that? One other way to modify the HTML output would be to set the Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Hi, Yes indeed the black text was the ones I had left as default, when I st them to a color they were saved as such in the HTML. This helps a lot, thank you very much! |
Beta Was this translation helpful? Give feedback.
-
Hi Will,
I'm implementing a method to export some stuff to .html in refy but I'm struggling a bit with how to set up the theme to get the look I need.
I defined a
TERMINAL_THEME
class like the one from rich and I could set the background color of html page, but I can't seem to be able to change individual elements.In particular I would like to be able to set the color of the links, that are in black currently as you can see in the screenshot:
but I couldn't figure out how to do this via a custom
Theme
class.Any help would be much appreciated,
thanks.
Fede
Beta Was this translation helpful? Give feedback.
All reactions