forked from LiveCarta/BookConverter
epub converter: fix color to all in hex 3
This commit is contained in:
@@ -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 '',
|
||||
|
||||
Reference in New Issue
Block a user