Syncfusion.XlsIO.Base
Example 


Color Property (IExtendedFormat)

Returns or sets the RGB color to cell.
Syntax
'Declaration
 
Property Color As Color
'Usage
 
Dim instance As IExtendedFormat
Dim value As Color
 
instance.Color = value
 
value = instance.Color
Color Color {get; set;}
Example
The following code illustrates how to set RGB color to Color property.
using Syncfusion.XlsIO;
using System.Drawing;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set color
            style.Color = Color.Red;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Get extended format
            IExtendedFormat format = worksheet["E2"].CellStyle;
            
            //Set color
            format.Color = Color.Red;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also