Class ThemeScript
java.lang.Object
wiiuu.ui.ThemeScript
WII-UU's theme language: small text files (.wtheme) that recolour the menu. A theme starts from
the built-in light or dark colours and changes what it wants, with variables, colour functions,
per-console tile colours and parts for light and dark mode:
theme "Sunset"
by "Someone"
base dark # light, dark, or auto (follow the computer)
let sun = #FF7A3D
accent = sun
card = lighten(#1A1033, 8%)
text-dim = mix(text, card, 35%)
background = gradient(#2B1748, #120A24)
consoles = mix(it, sun, 20%) # every console tile; "it" is its own colour
console n64 = #00A651
font "Nunito", "DejaVu Sans"
when dark { stripes = none }
Statements end at the end of the line; # (followed by a space) and // start comments. Errors
name the line and column, and suggest the closest name when one is misspelt. Evaluating needs
no screen: wiiuu --theme-check uses it too.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA mistake in a theme, with where it is (1-based).static final recordA theme, worked out. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ThemeScript.Resultevaluate(String source, String fallbackName, Function<Boolean, Map<String, Color>> builtIn, Function<String, Color> consoleColour, Set<String> consoleIds, boolean systemDark) Works a theme out.static StringThe name a theme gives itself (for lists), without working it out; null if it has none.
-
Field Details
-
PROPERTIES
-
FUNCTIONS
-
-
Method Details
-
evaluate
public static ThemeScript.Result evaluate(String source, String fallbackName, Function<Boolean, Map<String, Color>> builtIn, Function<String, throws ThemeScript.ErrorColor> consoleColour, Set<String> consoleIds, boolean systemDark) Works a theme out.- Parameters:
source- the theme's textfallbackName- its name if it doesn't say one (the file's name)builtIn- WII-UU's own colours, light (false) or dark (true), with every propertyconsoleColour- a console's own tile colour by id (null if there is no such console)consoleIds- every console idsystemDark- whether the computer is in dark mode now (for base auto)- Throws:
ThemeScript.Error
-
nameOf
-