/** * Set the foreground fill color as a indexed color value * * @param index - the color to use */ public void SetFillForegroundColor(int index) { CT_PatternFill ptrn = EnsureCTPatternFill(); CT_Color CT_Color = ptrn.IsSetFgColor() ? ptrn.fgColor : ptrn.AddNewFgColor(); CT_Color.indexed = (uint)index; }
public void TestGetFillForegroundColor() { CT_Fill ctFill = new CT_Fill(); XSSFCellFill cellFill = new XSSFCellFill(ctFill); CT_PatternFill ctPatternFill = ctFill.AddNewPatternFill(); CT_Color fgColor = ctPatternFill.AddNewFgColor(); Assert.IsNotNull(cellFill.GetFillForegroundColor()); fgColor.indexed = 8; fgColor.indexedSpecified = true; Assert.AreEqual(8, cellFill.GetFillForegroundColor().Indexed); }
public void SetFillForegroundColor(int index) { CT_PatternFill ctPatternFill = this.EnsureCTPatternFill(); (ctPatternFill.IsSetFgColor() ? ctPatternFill.fgColor : ctPatternFill.AddNewFgColor()).indexed = (uint)index; }