Excel.ChangePalette method


I have the following code:


chart.Title.TextFont.Color = Color.FromArgb(200,224,240);

I expect this to give me a light blue colour. But instead, it gives me some shade of orange, similar to 255, 102, 0. What am I doing wrong? I am not understanding the connection between the palette index and the R/G/B values.


Sorry. This problem is caused by a small bug. Please try this attached v3.7.1.1.


Was my code correct ?

I think I am still getting inconsistent behaviour with the colours, but I will test it again thoroughly.

Why is it required to change the palette before assigning a colour to any of the chart elements?

Am I right in saying that ChangePalette replaces the colour in the given palette index, e.g. 53 with the colour represented by the RGB combination ? If I go to Tools/Options/Color in Excel, I see 56 colours (0-55). How are they numbered - starting with the first row and going across, or starting with the first column and going down ?


Your code is correct.

Please check http://www.aspose.com/wiki/default.aspx/Aspose.Cells/ColorAndPalette.html for more information. A standard color palette is listed at http://www.aspose.com/Products/Aspose.Cells/Api/Aspose.Cells.Excel.ChangePalette.html .

If your color is already in the palette, you don't need to change the palette. You can use Excel.IsColorInPalette method to check it.