Font settings not applied to conditional formatting

Issue #266 resolved
Adam Morris created an issue

Font settings not working correctly with conditional formatting - for example, with the below script, when the conditional formatting highlights a cell, the background is red, but the text is not white.

from openpyxl import Workbook
from import Color, Fill, Font

wb = Workbook()
ws =

# Create fill
redFill = Fill()
redFill.start_color.index = 'FFEE1111'
redFill.end_color.index = 'FFEE1111'
redFill.fill_type = Fill.FILL_SOLID

whiteFont = Font()
whiteFont.color.index = "FFFFFFFF"
#whiteFont.color.index = "FFFFFF"

ws.conditional_formatting.addCellIs('A1:A3', 'equal', ['"Fail"'], False, wb, whiteFont, None, redFill)"test.xlsx")

Comments (2)

  1. Log in to comment