2023-05-05 17:04:13 +00:00
|
|
|
--
|
|
|
|
-- Graphics Style Options
|
|
|
|
--
|
|
|
|
|
2024-03-06 16:43:31 +00:00
|
|
|
local core = require("graphics.core")
|
|
|
|
local themes = require("graphics.themes")
|
2023-05-05 17:04:13 +00:00
|
|
|
|
2024-03-06 16:43:31 +00:00
|
|
|
---@class svr_style
|
2023-05-05 17:04:13 +00:00
|
|
|
local style = {}
|
|
|
|
|
2023-05-12 00:06:41 +00:00
|
|
|
local cpair = core.cpair
|
2023-05-05 17:04:13 +00:00
|
|
|
|
2024-03-11 16:35:06 +00:00
|
|
|
style.theme = themes.sandstone
|
2024-03-06 16:43:31 +00:00
|
|
|
style.fp = themes.get_fp_style(style.theme)
|
2024-03-12 16:24:32 +00:00
|
|
|
style.colorblind = false
|
2023-09-02 02:24:31 +00:00
|
|
|
|
|
|
|
style.ind_grn = cpair(colors.green, colors.green_off)
|
|
|
|
|
2024-03-08 00:23:46 +00:00
|
|
|
-- set theme per configuration
|
2024-03-12 16:24:32 +00:00
|
|
|
---@param fp FP_THEME front panel theme
|
2024-03-12 17:15:28 +00:00
|
|
|
---@param color_mode COLOR_MODE the color mode to use
|
2024-03-12 16:24:32 +00:00
|
|
|
function style.set_theme(fp, color_mode)
|
|
|
|
if fp == themes.FP_THEME.SANDSTONE then
|
2024-03-08 00:23:46 +00:00
|
|
|
style.theme = themes.sandstone
|
2024-03-12 16:24:32 +00:00
|
|
|
elseif fp == themes.FP_THEME.BASALT then
|
2024-03-08 00:23:46 +00:00
|
|
|
style.theme = themes.basalt
|
|
|
|
end
|
|
|
|
|
|
|
|
style.fp = themes.get_fp_style(style.theme)
|
2024-03-12 16:24:32 +00:00
|
|
|
|
2024-03-25 14:11:35 +00:00
|
|
|
style.colorblind = color_mode ~= themes.COLOR_MODE.STANDARD and color_mode ~= themes.COLOR_MODE.STD_ON_BLACK
|
2024-03-08 00:23:46 +00:00
|
|
|
end
|
|
|
|
|
2023-05-05 17:04:13 +00:00
|
|
|
return style
|