def has_font_back_color(t_cell):
"""
Checks if the cell foreground and background are the same color in an attempt to hide cells
:param t_cell: a cell with formatting information
:return: fb_check: a boolean indicating whether font and background is the same color
"""
fb_check = False
if not t_cell.value is None:
f_color = t_cell.font.color.index
b_color = t_cell.fill.start_color.index
if f_color == b_color:
fb_check = True
return fb_check
In the function t_cell is a cell variable passed to the function from a main program that sequentially reads and tests cells from a given range. When printing the index values the console indicates 00000000 for both the font and background color. Using .rgb generates the same values. When using .color the console indicates the following:
Color(rgb='00000000',
indexed=Values must be of type <class 'int'>, auto=Values must be
of type <class 'bool'>, theme=Values must be of type <class
'int'>, tint=0.0, type='rgb').
--
You received this message because you are subscribed to the Google Groups "openpyxl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpyxl-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/openpyxl-users/2eb250ed-fa3a-4a33-b2e3-536b0480f703n%40googlegroups.com.