[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

ThemeColor

Enum Class ThemeColor

java.lang.Object
java.lang.Enum<ThemeColor>
com.grapecity.documents.excel.ThemeColor
All Implemented Interfaces:
Serializable, Comparable<ThemeColor>, Constable

public enum ThemeColor extends Enum<ThemeColor>
按显示顺序指定内置主题颜色。

使用此枚举可引用工作簿主题中的颜色,例如浅色和深色、强调色以及超链接颜色。在自定义 Theme 颜色方案或将基于主题的颜色应用于工作簿内容时,可以使用这些常量。


 Theme theme = new Theme("customTheme");
 theme.getThemeColorScheme().get(ThemeColor.Light1).setRGB(Color.GetAntiqueWhite());
 theme.getThemeColorScheme().get(ThemeColor.Accent1).setRGB(Color.GetBlue());
 workbook.setTheme(theme);
 
  • Enum Constant Details

    • None

      public static final ThemeColor None
      指定不使用任何主题颜色。
    • Light1

      public static final ThemeColor Light1
      指定浅色1主题颜色。
    • Dark1

      public static final ThemeColor Dark1
      指定深色1主题颜色。
    • Light2

      public static final ThemeColor Light2
      指定浅色2主题颜色。
    • Dark2

      public static final ThemeColor Dark2
      指定深色2主题颜色。
    • Accent1

      public static final ThemeColor Accent1
      指定强调色1的主题颜色。
    • Accent2

      public static final ThemeColor Accent2
      指定强调色2主题颜色。
    • Accent3

      public static final ThemeColor Accent3
      指定强调色3主题颜色。
    • Accent4

      public static final ThemeColor Accent4
      指定强调色4主题颜色。
    • Accent5

      public static final ThemeColor Accent5
      指定强调色5主题颜色。
    • Accent6

      public static final ThemeColor Accent6
      指定强调色6主题颜色。
  • Method Details

    • values

      public static ThemeColor[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ThemeColor valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Gets the integer value of the theme color.
      Returns:
      The integer value of the theme color.
    • forValue

      public static ThemeColor forValue(int value)
      Returns the theme color associated with the specified integer value.
      Parameters:
      value - The integer value of the theme color.
      Returns:
      The ThemeColor enum constant associated with the specified value.
      Throws:
      IllegalArgumentException - if value does not match a defined theme color.