Other API Samples

Live SpreadsheetGear API Samples

Snippets Interior Color (Tint & Shade)

Applies a theme color to a range and then alters the "TintAndShade" value to make the theme color lighter or darker.

IWorkbook workbook = Factory.GetWorkbook();
IWorksheet worksheet = workbook.ActiveWorksheet;
IRange cells = worksheet.Cells;
cells["A1:F10"].Interior.ThemeColor = ColorSchemeIndex.Accent1;
for (int row = 0; row < 10; row++)
{
  double val = -0.5 + (2.0 / 15) * row;
  cells[row, 0].EntireRow.Interior.TintAndShade = val;
}
Run This Sample
Render Image

Generate an image representation of the results of this sample, which uses the SpreadsheetGear.Drawing.Image class to convert ranges, charts and shapes to images.


Download File

Download an Excel Open XML Workbook (*.xlsx) file with the results of this sample.