Class Theme.Builder

java.lang.Object
io.keikai.axyra.sheets.style.Theme.Builder
Enclosing class:
Theme

public static final class Theme.Builder extends Object
Fluent builder for a Theme; see Theme.builder() and Theme.toBuilder().
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • color

      public Theme.Builder color(Theme.Slot slot, String token)
      Sets a slot to a raw six-digit hex token, "RRGGBB", without a leading #. The token is written to the theme part as-is. A system name such as "windowText", an eight-digit "AARRGGBB" token or null gives an invalid theme color in the saved file. Prefer color(Slot, Color).
      Parameters:
      slot - the slot to set
      token - the six-digit hex token
      Returns:
      this builder
    • color

      public Theme.Builder color(Theme.Slot slot, Color color)
      Sets a slot to an RGB color, stored as "RRGGBB". The alpha channel is dropped.
      Parameters:
      slot - the slot to set
      color - an RGB color; null clears the slot, which saves as an empty, invalid color
      Returns:
      this builder
      Throws:
      IllegalStateException - if color is a theme, indexed or automatic color
    • majorFont

      public Theme.Builder majorFont(String name)
      Sets the heading font name (the theme's major font).
      Parameters:
      name - the font family name, e.g. "Calibri Light"
      Returns:
      this builder
    • minorFont

      public Theme.Builder minorFont(String name)
      Sets the body font name (the theme's minor font). Cells whose font uses the minor scheme render in it.
      Parameters:
      name - the font family name, e.g. "Calibri"
      Returns:
      this builder
    • build

      public Theme build()
      Builds an immutable theme; later builder calls do not change it.
      Returns:
      the theme