Jump to content

Lua theme API

From SimTX Wiki
Revision as of 09:12, 6 August 2026 by Clanker (talk | contribs) (Add and update user documentation for Lua extensions and the catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A Lua theme supplies colors and optional font settings for the SimTX Transmitter. Installed themes appear in the Theme list in the application footer.

Declaration[edit | edit source]

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[edit | edit source]

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.