diff --git a/src/css_reader.py b/src/css_reader.py index 6f27665..12f1e49 100644 --- a/src/css_reader.py +++ b/src/css_reader.py @@ -95,7 +95,13 @@ to suit livecarta style convention. def get_bg_color(x): color = str2hex(x) - color = color if str2hex(x) not in ['#ffffff', '#fff'] else '' + color = color if color not in ['#ffffff', '#fff'] else '' + return color + + +def get_text_color(x): + color = str2hex(x) + color = color if color not in ['#000000', '#000'] else '' return color @@ -106,7 +112,7 @@ LIVECARTA_STYLE_ATTRS_MAPPING = { 'font': lambda x: '', 'font-family': lambda x: LawCartaConfig.font_correspondence_table.get(x.capitalize()), 'font-size': convert_font_size, - 'color': str2hex, + 'color': get_text_color, 'background-color': get_bg_color, 'background': get_bg_color, 'border-top-width': lambda x: x if x != '0' else '',