Class Theme

java.lang.Object
io.keikai.axyra.sheets.style.Theme

public final class Theme extends Object
The workbook theme — the 12-slot color scheme plus the major (heading) and minor (body) font names. Theme colors are the source Excel resolves Color.theme(...) references against.

Color slots are raw OOXML tokens: usually "RRGGBB"/"AARRGGBB" hex (no leading #), but dk1/lt1 are frequently the system tokens "windowText"/"window". Use color(Slot) for the raw token and rgb(Slot) for a parsed Color (null when the slot is a system token).

  • Field Details

    • SLOT_COUNT

      public static final int SLOT_COUNT
      Number of color slots in a theme.
      See Also:
  • Method Details

    • of

      public static Theme of(String[] colors, String majorFont, String minorFont)
      Build a Theme from the engine's raw representation: the 12 color tokens (a shorter/longer array is padded/truncated to 12) and the fonts.
    • color

      public String color(Theme.Slot slot)
      The raw color token for slot (hex or a system token), or null.
    • rgb

      public Color rgb(Theme.Slot slot)
      The slot color as a Color, or null when it is a system token / unset.
    • majorFont

      public String majorFont()
      The major (heading) font name.
    • minorFont

      public String minorFont()
      The minor (body) font name.
    • colors

      public String[] colors()
      The 12 raw color tokens (defensive copy; slots may be null).
    • toBuilder

      public Theme.Builder toBuilder()
    • builder

      public static Theme.Builder builder()