#340 colorblind modes for rtu, reactor-plc, and supervisor
This commit is contained in:
@@ -19,9 +19,10 @@ local ui = {
|
||||
}
|
||||
|
||||
-- try to start the UI
|
||||
---@param theme integer front panel theme ID (1 = sandstone, 2 = basalt)
|
||||
---@param theme FP_THEME front panel theme
|
||||
---@param color_mode COLOR_MODE color mode
|
||||
---@return boolean success, any error_msg
|
||||
function renderer.try_start_ui(theme)
|
||||
function renderer.try_start_ui(theme, color_mode)
|
||||
local status, msg = true, nil
|
||||
|
||||
if ui.display == nil then
|
||||
@@ -39,6 +40,12 @@ function renderer.try_start_ui(theme)
|
||||
term.setPaletteColor(style.theme.colors[i].c, style.theme.colors[i].hex)
|
||||
end
|
||||
|
||||
-- apply color mode
|
||||
local c_mode_overrides = style.theme.color_modes[color_mode]
|
||||
for i = 1, #c_mode_overrides do
|
||||
term.setPaletteColor(c_mode_overrides[i].c, c_mode_overrides[i].hex)
|
||||
end
|
||||
|
||||
-- init front panel view
|
||||
status, msg = pcall(function ()
|
||||
ui.display = DisplayBox{window=term.current(),fg_bg=style.fp.root}
|
||||
|
||||
Reference in New Issue
Block a user