Lua theme API
A Lua theme supplies colors and optional font settings for the SimTX Transmitter. Installed themes appear in the Theme list in the application footer.
How to use this reference
To use an existing theme, select it in the footer. To write one, create a package declaring types=theme, place the declaration below in its entry file, reload, and select the new theme. Start with the semantic colors and check text contrast; the optional Swing ui overrides are for finer adjustments.
Declaration
simtx.theme {
name = "Midnight",
description = "A high-contrast dark theme.",
colors = {
background = "#10161f",
surface = "#17212d",
surface_alt = "#202c3a",
foreground = "#e8f0fa",
muted = "#91a0b3",
accent = "#4ac8ff",
selection = "#24506a",
border = "#34475b",
success = "#58d68d",
warning = "#f2c33c",
danger = "#ff665c",
meter = "#4ac8ff",
},
font = {family = "SansSerif", size = 13},
ui = {
["Table.gridColor"] = "#233246",
["ToolTip.background"] = "#202c3a",
},
}
Fields
| Field | Required | Meaning |
|---|---|---|
name |
Yes | Name shown in the Theme list. |
description |
No | User-facing description. |
colors |
Yes | Table of semantic color roles. |
font |
No | Font family string, or a table containing family and non-negative size.
|
ui |
No | Table of Swing UI property names to colors for details not covered by semantic roles. |
Supported semantic roles are background, surface, surface_alt, foreground, muted, accent, selection, border, success, warning, danger, and meter. Omitted roles retain a suitable application default.
Colors may use #RGB, #RRGGBB, or #AARRGGBB. The names black, white, red, green, blue, gray, grey, orange, and yellow are also accepted.
The ui table is optional and is applied after the semantic roles. It is intended for established Swing UI property names. A theme should remain usable when this table is omitted.