How to set Customized Color in Cell

Hi.

How to Set customized colors in Cell.

Sunil

Hi Sunil,

Thank you for considering Aspose.

You can use Style.ForegroundColor to set the color of a Cell. Please see the sample code which assigns Foreground color to a Cell.

Workbook wb= new Workbook();
Cells cells = wb.Worksheets[0].Cells;
Cell cell = cells[0,0];
cell.PutValue("Color");
int index = wb.Styles.Add();
Style style = wb.Styles[index];
//For Cell's filling color
style.ForegroundColor = System.Drawing.Color.FromArgb(0, 255, 255);;
style.Pattern = BackgroundType.Solid;
cell.Style = style;
wb.Save("d:\\Output.xls");

Please see the following link for colors & Background Patterns,

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/colors-background-patterns.html

Thank you & Best Regards,