Issue in Cell foreground using Color.FromArgb

Hello,

i am currently using

aspose.cell V 4.0.1.0

i am trying to put color in the cell using

cells1(0, 1).Style.ForegroundColor = Color.FromArgb(165, 200, 236)

cells1(0, 1).Style.Pattern = BackgroundType.Solid

i am also using following color code

165,200,236–blue light

228,237,246–blue lighter

204, 234, 175–greenlight

235,247,224–greenlighter

250,253,247–cream,but nothing works all gives a dark black background

but when i tried 250,0,0 it worked and gave a red background

i am also attaching a excel file to reference you the kind of output i am expecting

Kindly help

Thanks and Regards

–Zaid

Hi Zaid,

Thank you for considering Aspose.

Since you are applying custom colors to cells, so you need to add those custom colors to the MS Excel standard color palette before setting them. For your information, Ms Excel standard color palette has only 56 colors. The colors are indexed 0-55. Please check document topic:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.workbook.changepalette.html

If a color is not present on the palette, we have to add it to the palette, please check the following link for reference:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/colors-and-palette.html

Thank You & Best Regards,