Generate correct html from xterm colors.
This commit is contained in:
parent
28b2c9bae9
commit
9ecc65bd12
2 changed files with 3 additions and 4 deletions
|
|
@ -147,9 +147,9 @@ class CharStyle:
|
|||
underline_code = ("text-decoration:underline; "
|
||||
if self.is_underlined else "")
|
||||
fg_color = (self.fg_color if type(self.fg_color) == tuple
|
||||
else xterm_colors[self.fg_color])
|
||||
else XTERM_COLORS[self.fg_color])
|
||||
bg_color = (self.bg_color if type(self.bg_color) == tuple
|
||||
else xterm_colors[self.bg_color])
|
||||
else XTERM_COLORS[self.bg_color])
|
||||
return (f"<style>.S{id(self)} {{font-size:80%%; color:rgb{fg_color!r};"
|
||||
f" background-color:rgb{bg_color!r}; "
|
||||
f"{bold_code}{italic_code}{underline_code}}}</style>")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env python3.9
|
||||
|
||||
|
||||
import os
|
||||
import pickle
|
||||
import unittest
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue