The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I need to specify the background colors of a range of cells however there seems to be a conflict between the colorindex values used in excel and the colorindex values used in XlsIO.
For example, the color index value of 36 should return a light yellow, however I seem to be getting a purple color instead.
I'm referring to the following page for excel color index values: http://www.mvps.org/dmcritchie/excel/colors.htm If you scroll down to "Color 36", you'll notice it's the light yellow color I'm looking for.
Here's the code I'm using to try to set the color to light yellow: ExcelKnownColors knownEnm = (ExcelKnownColors)36; range.CellStyle.ColorIndex = knownEnm;
What code should I be using so the color index values do in fact follow excel's color pallette?
MWMelba Winshia Syncfusion Team January 3, 2007 01:41 PM UTC
Hi Ryan,
I was able to reproduce the problem. However our custom color starts from 0 and excel color starts from 1. So excel color index value of 36 is equivalent to XlsIO color index value of 35. Use the following code snippets to set light yellow for the cell background.