Package io.keikai.axyra.sheets.style
Class Theme.Builder
java.lang.Object
io.keikai.axyra.sheets.style.Theme.Builder
- Enclosing class:
- Theme
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an immutable theme; later builder calls do not change it.color(Theme.Slot slot, Color color) Sets a slot to an RGB color, stored as"RRGGBB".color(Theme.Slot slot, String token) Sets a slot to a raw six-digit hex token,"RRGGBB", without a leading#.Sets the heading font name (the theme's major font).Sets the body font name (the theme's minor font).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
color
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 ornullgives an invalid theme color in the saved file. Prefercolor(Slot, Color).- Parameters:
slot- the slot to settoken- the six-digit hex token- Returns:
- this builder
-
color
Sets a slot to an RGB color, stored as"RRGGBB". The alpha channel is dropped.- Parameters:
slot- the slot to setcolor- an RGB color;nullclears the slot, which saves as an empty, invalid color- Returns:
- this builder
- Throws:
IllegalStateException- ifcoloris a theme, indexed or automatic color
-
majorFont
Sets the heading font name (the theme's major font).- Parameters:
name- the font family name, e.g."Calibri Light"- Returns:
- this builder
-
minorFont
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
Builds an immutable theme; later builder calls do not change it.- Returns:
- the theme
-