This commit is contained in:
Mikayla Fischler 2024-03-25 10:11:35 -04:00
parent 55e4e5a68b
commit b94c89f4ec
8 changed files with 23 additions and 19 deletions

View File

@ -45,7 +45,7 @@ local RIGHT = core.ALIGN.RIGHT
local changes = {
{ "v1.2.4", { "Added temperature scale options" } },
{ "v1.2.12", { "Added main UI theme", "Added front panel UI theme", "Added color accessibility modes" } },
{ "v1.3.3", { "Added blue indicators color mode" } }
{ "v1.3.3", { "Added standard with black off state color mode", "Added blue indicator color modes" } }
}
---@class crd_configurator

View File

@ -88,19 +88,19 @@ style.theme = smooth_stone
---@param fp FP_THEME front panel theme
---@param color_mode COLOR_MODE the color mode to use
function style.set_themes(main, fp, color_mode)
local colorblind = not (color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.STD_ON_BLACK)
local black_ind_off = color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.BLUE_IND
local colorblind = color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.STD_ON_BLACK
local gray_ind_off = color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.BLUE_IND
style.ind_bkg = colors.gray
style.fp_ind_bkg = util.trinary(black_ind_off, colors.black, colors.gray)
style.ind_hi_box_bg = util.trinary(black_ind_off, colors.black, colors.gray)
style.fp_ind_bkg = util.trinary(gray_ind_off, colors.gray, colors.black)
style.ind_hi_box_bg = util.trinary(gray_ind_off, colors.gray, colors.black)
if main == themes.UI_THEME.SMOOTH_STONE then
style.theme = smooth_stone
style.ind_bkg = util.trinary(black_ind_off, colors.black, colors.gray)
style.ind_bkg = util.trinary(gray_ind_off, colors.gray, colors.black)
elseif main == themes.UI_THEME.DEEPSLATE then
style.theme = deepslate
style.ind_hi_box_bg = util.trinary(black_ind_off, colors.black, colors.lightGray)
style.ind_hi_box_bg = util.trinary(gray_ind_off, colors.lightGray, colors.black)
end
style.colorblind = colorblind

View File

@ -40,7 +40,7 @@ local changes = {
{ "v1.6.2", { "AuthKey minimum length is now 8 (if set)" } },
{ "v1.6.8", { "ConnTimeout can now have a fractional part" } },
{ "v1.6.15", { "Added front panel UI theme", "Added color accessibility modes" } },
{ "v1.7.3", { "Added blue indicators color mode" } }
{ "v1.7.3", { "Added standard with black off state color mode", "Added blue indicator color modes" } }
}
---@class plc_configurator

View File

@ -2,8 +2,6 @@
-- Graphics Style Options
--
local util = require("scada-common.util")
local core = require("graphics.core")
local themes = require("graphics.themes")
@ -31,9 +29,13 @@ function style.set_theme(fp, color_mode)
style.fp = themes.get_fp_style(style.theme)
style.colorblind = not (color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.STD_ON_BLACK)
style.colorblind = color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.STD_ON_BLACK
style.ind_bkg = util.trinary(color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.BLUE_IND, colors.black, colors.gray)
if color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.BLUE_IND then
style.ind_bkg = colors.gray
else
style.ind_bkg = colors.black
end
end
return style

View File

@ -78,7 +78,7 @@ assert(#PORT_DSGN == rsio.NUM_PORTS)
local changes = {
{ "v1.7.9", { "ConnTimeout can now have a fractional part" } },
{ "v1.7.15", { "Added front panel UI theme", "Added color accessibility modes" } },
{ "v1.9.2", { "Added blue indicators color mode" } }
{ "v1.9.2", { "Added standard with black off state color mode", "Added blue indicator color modes" } }
}
---@class rtu_rs_definition

View File

@ -2,8 +2,6 @@
-- Graphics Style Options
--
local util = require("scada-common.util")
local core = require("graphics.core")
local themes = require("graphics.themes")
@ -30,9 +28,13 @@ function style.set_theme(fp, color_mode)
style.fp = themes.get_fp_style(style.theme)
style.colorblind = not (color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.STD_ON_BLACK)
style.colorblind = color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.STD_ON_BLACK
style.ind_bkg = util.trinary(color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.BLUE_IND, colors.black, colors.gray)
if color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.BLUE_IND then
style.ind_bkg = colors.gray
else
style.ind_bkg = colors.black
end
end
return style

View File

@ -37,7 +37,7 @@ local RIGHT = core.ALIGN.RIGHT
-- changes to the config data/format to let the user know
local changes = {
{ "v1.2.12", { "Added front panel UI theme", "Added color accessibility modes" } },
{ "v1.3.2", { "Added blue indicators color mode" } }
{ "v1.3.2", { "Added standard with black off state color mode", "Added blue indicator color modes" } }
}
---@class svr_configurator

View File

@ -28,7 +28,7 @@ function style.set_theme(fp, color_mode)
style.fp = themes.get_fp_style(style.theme)
style.colorblind = not (color_mode == themes.COLOR_MODE.STANDARD or color_mode == themes.COLOR_MODE.STD_ON_BLACK)
style.colorblind = color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.STD_ON_BLACK
end
return style