Theming
Every colour, radius, blur and duration in of_ui is a token. A full set of tokens exports as one short code (OF1-...) that you can pin as your server's default, offer as a preset, or paste into another server.
The settings menu
Players open it with:
/themesettingsThey can also import a code straight away, skipping the menu:
/themesettings OF1-fWNj4N8...Codes are validated and checksummed on import, so a bad paste is rejected rather than applied.
A player's theme is stored per client and survives resource restarts.
Configuration
config/config.lua:
Config.Theme = {
-- Server default. Players start from this one; Reset returns them to it.
Default = nil, -- e.g. 'OF1-fWNj/4N8...'
-- Let players open the menu and keep their own theme.
AllowPlayerTheming = true,
-- Tokens the player may not change, by registry path.
LockedTokens = {},
-- Themes offered as one-click chips in the menu.
Presets = {
-- { label = 'Midnight', code = 'OF1-...' },
},
-- Chat command that opens the menu. false for none.
Command = 'themesettings',
-- Keybind that opens the menu. false for none.
Keybind = false,
}| Field | Type | Description |
|---|---|---|
Default | string? | Theme code every player starts from. nil uses the built-in defaults. |
AllowPlayerTheming | boolean? | false locks the theme to Default and blocks saving. |
LockedTokens | string[]? | Token paths the player cannot change, e.g. { 'global.accent', 'global.accentHover' }. |
Presets | table[]? | { label, code } chips shown in the menu. |
Command | string|false? | Chat command. Omit it entirely and it falls back to themesettings. |
Keybind | string|false? | Default key for opening the menu. |
Pinning your branding
To keep your server's accent colour while letting players change everything else:
Config.Theme = {
Default = 'OF1-...', -- your theme code
AllowPlayerTheming = true,
LockedTokens = { 'global.accent', 'global.accentHover' },
}Making a theme
- Open
/themesettingsin game. - Adjust tokens; the preview updates as you go.
- Copy the theme code from the export field.
- Paste it into
Config.Theme.Default, or intoPresetsas a one-click chip.
Breaking updates
Theme codes are versioned. Regenerate your codes from the settings menu after an update that adds a component, and check the changelog before updating a live server.
Per-call overrides
Some components take their own colour without touching the theme, for cases where the meaning is specific rather than stylistic:
