Choose materials, then colours
Name a palette in [colors] and shape shared controls with [surfaces.Name] materials.
[colors] names your palette and [surfaces.Name] gives a shared control or
panel its shape and material. Every theme that changes more than its base's
look needs both.
The worked example
Use semantic colour names rather than assigning a different hex value to every widget. Shared surfaces and derived states can then follow one coherent palette:
[colors]
SurfacePanel = "#18232d"
SurfaceInput = "#080e13"
BorderControl = "#82939f"
TextPrimary = "#e4edf2"
AccentCyan = "#59dcf5"
A surface describes the shape and material of a shared control or panel:
[surfaces.Button]
chamferTL = 4
chamferBR = 4
fillFrom = "#3d4b56"
fillMid = "#303b43"
fillMidStop = 0.18
fillTo = "#121c24"
angle = 180
border = "@BorderControl"
borderWidth = 1
highlight = "#c0d0dbb3"
highlightY = 1
accentBar = "#02060a"
accentBarY = -2
grain = "#c8deed09"
grainAngle = 90
grainPeriod = 3
grainWidth = 0.65
[surfaces.ButtonHover]
base = "Button"
border = "@AccentCyan"
The three gradient stops make a metallic shoulder, while the light top edge and dark lower edge give the face depth. Grain is procedural; it is not an image texture. Corners and shadows change drawing, not the hit box or gameplay.
Colours
Hex colours use #RRGGBB or #RRGGBBAA. A value such as "@AccentCyan"
references another colour. References must resolve without loops. Names are
case-insensitive. Keep success, warning, error, metal and energy distinguishable
from ordinary selection; changing the accent should not erase game information.
Replacing and reusing surfaces
A [surfaces.Name] or [fonts.Name] entry replaces that inherited entry in full.
Use base to reuse another surface; never make a surface its own base. Colour
references and surface bases resolve after the theme layers are combined.
Overriding Button can therefore affect surfaces that derive from it.
Surface controls
| Property family | Keys | What it changes |
|---|---|---|
| Corners | radius, radiusTL/TR/BR/BL, chamfer, chamferTL/TR/BR/BL |
Rounded or cut corners; a chamfer takes precedence |
| Fill | fill, or fillFrom, fillMid, fillTo, fillMidStop |
Flat colour or two/three-stop gradient |
| Gradient | angle, gradient, centerX, centerY |
Linear angle or radial centre; gradient is linear or radial |
| Border | border, borderWidth |
Inner edge colour and width |
| Shadows | shadow, glow, inset plus X, Y, Blur, Spread suffixes |
Outer shadow/glow or soft inset shadow |
| Hard edges | highlight, accentBar plus X, Y suffixes |
Inset bevel or selection stripe |
| Grain | grain, grainAngle, grainPeriod, grainWidth |
Fine directional material pattern |
| Image skin | image, sliceLeft/Top/Right/Bottom, imageBorderLeft/Top/Right/Bottom |
An authored nine-slice image over the procedural face; source insets use pixels, drawn borders use layout units |
| Reuse | base |
Another named surface to extend |
Lengths are layout units, scaled by AEX, except source image slice insets, which are image pixels. Do not bake a screen resolution into padding or frame artwork. Start from existing geometry and check small windows, high-DPI displays, HUD scale and long labels before increasing spacing.
What goes wrong
A colour reference that names nothing, or loops back on itself, is logged (names appear in lower case):
UiTheme: colour <name> names @<target>, which is missing or circular
A surface whose base is missing or circular is logged and drawn from its own
keys only:
UiTheme: surface <name> names unknown base <base>
UiTheme: surface <name> has a circular base <base>