diff --git a/OpenXmlFormats/Spreadsheet/Styles/CT_Font.cs b/OpenXmlFormats/Spreadsheet/Styles/CT_Font.cs index 98011b82e..96c21692b 100644 --- a/OpenXmlFormats/Spreadsheet/Styles/CT_Font.cs +++ b/OpenXmlFormats/Spreadsheet/Styles/CT_Font.cs @@ -512,6 +512,14 @@ public CT_Color AddNewColor() this.colorField.Add(newColor); return newColor; } + public int AddColor(CT_Color value) + { + colorField = colorField ?? new List(); + + colorField.Add(value); + + return this.colorField.Count - 1; + } #endregion color #region sz diff --git a/ooxml/XSSF/UserModel/XSSFFontFormatting.cs b/ooxml/XSSF/UserModel/XSSFFontFormatting.cs index f7ff5a2d9..74b81dff3 100644 --- a/ooxml/XSSF/UserModel/XSSFFontFormatting.cs +++ b/ooxml/XSSF/UserModel/XSSFFontFormatting.cs @@ -108,7 +108,7 @@ public IColor FontColor } else { - _font.SetColorArray(0, xcolor.GetCTColor()); + _font.AddColor(xcolor.GetCTColor()); } } }