Skip to content

Commit 900e880

Browse files
committed
Skip setting white backgournd color
1 parent 4cf6299 commit 900e880

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pydocx/openxml/wordprocessing/table_cell_properties.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
)
77

88
from pydocx.models import XmlModel, XmlChild
9+
from pydocx.constants import COLOR_FOR_DARK_BACKGROUND
910

1011

1112
class TableCellProperties(XmlModel):
@@ -30,10 +31,8 @@ def should_close_previous_vertical_merge(self):
3031

3132
@property
3233
def background_color(self):
33-
background_fill = getattr(self, 'background_fill', None)
34-
3534
# There is no need to set white background color
36-
if background_fill not in ('auto', 'FFFFFF'):
37-
return background_fill
35+
if self.background_fill not in ('auto', COLOR_FOR_DARK_BACKGROUND):
36+
return self.background_fill
3837

3938
return None

0 commit comments

Comments
 (0)