ThemeColor Class |
Namespace: Aspose.Cells
The ThemeColor type exposes the following members.
Name | Description | |
---|---|---|
![]() | ThemeColor | Initializes a new instance of the ThemeColor class |
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
[C#] //Instantiating a Workbook object Workbook workbook = new Workbook(); Cells cells = workbook.Worksheets[0].Cells; cells["A1"].PutValue("Hello World"); Style style = cells["A1"].GetStyle(); //Set ThemeColorType.Text2 color type with 40% lighten as the font color. style.Font.ThemeColor = new ThemeColor(ThemeColorType.Text2, 0.4); style.Pattern = BackgroundType.Solid; //Set ThemeColorType.Background2 color type with 75% darken as the foreground color style.ForegroundThemeColor = new ThemeColor(ThemeColorType.Background2, -0.75); cells["A1"].SetStyle(style); //Saving the Excel file workbook.Save("C:\\book1.xlsx"); [Visual Basic] 'Instantiating a Workbook object Dim workbook As Workbook = New Workbook() Dim cells As Cells = workbook.Worksheets(0).Cells cells("A1").PutValue("Hello World") 'Get the cell style Dim style As Style = cells("A1").GetStyle() 'Set ThemeColorType.Text2 color type with 40% lighten as the font color. Style.Font.ThemeColor = New ThemeColor(ThemeColorType.Text2, 0.4) Style.Pattern = BackgroundType.Solid 'Set ThemeColorType.Background2 color type with 75% darken as the foreground color style.ForegroundThemeColor = New ThemeColor(ThemeColorType.Background2, -0.75) 'Set the cell style cells("A1").SetStyle(style) 'Saving the Excel file Workbook.Save("C:\\book1.xlsx")