[]
        
(Showing Draft Content)

IThemeColorScheme

Interface IThemeColorScheme


public interface IThemeColorScheme
Represents the theme color scheme.

This interface provides access to individual color entries in a theme, such as light, dark, accent, and hyperlink colors. Use get(ThemeColor) to get a specified theme color entry.


 Theme theme = new Theme("CustomTheme", Themes.GetBerlin());
 workbook.setTheme(theme);
 IThemeColorScheme colorScheme = workbook.getTheme().getThemeColorScheme();
 IThemeColor accent1 = colorScheme.get(ThemeColor.Accent1);
 accent1.setRGB(Color.GetRed());
 
  • Method Details

    • get

      IThemeColor get(ThemeColor index)
      Gets the IThemeColor using ThemeColor.

      Use this method to access a specific theme color entry, such as ThemeColor.Accent1 or ThemeColor.Hyperlink, from the current workbook theme color scheme.

      
       IThemeColorScheme colorScheme = workbook.getTheme().getThemeColorScheme();
       IThemeColor accent1 = colorScheme.get(ThemeColor.Accent1);
       Color accentColor = accent1.getRGB();
       
      Parameters:
      index - Specifies the ThemeColor. null is allowed.
      Returns:
      The IThemeColor for the specified ThemeColor. Returns null if index is null or ThemeColor.None.
    • getCount

      int getCount()
      Gets the number of theme color entries in this theme color scheme.

      This value indicates how many theme color entries are available in the current IThemeColorScheme collection.

      
       Theme theme = new Theme("CustomTheme");
       IThemeColorScheme colorScheme = theme.getThemeColorScheme();
       int count = colorScheme.getCount();
       
      Returns:
      The number of theme color entries in this theme color scheme.