ui.theme read/write property


Get or set the current application color theme, as a string value :

  • "dark" : uses the Windows dark theme for the application
  • "light" : uses the Windows light theme for the application

LuaRT applications uses by default the current Windows theme.
Setting this property will force the use of another theme.

LuaRT applications will automatically change current theme if user changes the Windows theme setting.

Example

local ui = require "ui" local win = ui.Window("ui.theme example", 320, 200) win:center() local button = ui.Button(win, ui.systheme) button:center() function button:onClick() ui.theme = ui.theme == "dark" and "light" or "dark" button.text = ui.theme end ui.run(win):wait()