#91 recoloring of horizontal and vertical bar indicators

This commit is contained in:
Mikayla Fischler 2022-09-12 14:43:01 -04:00
parent cd6bb7376d
commit 1bf21564f9
2 changed files with 12 additions and 0 deletions

View File

@ -98,6 +98,7 @@ local function hbar(args)
end end
end end
-- change bar color
---@param bar_fg_bg cpair new bar colors ---@param bar_fg_bg cpair new bar colors
function e.recolor(bar_fg_bg) function e.recolor(bar_fg_bg)
bar_bkg = bar_fg_bg.blit_bkg bar_bkg = bar_fg_bg.blit_bkg

View File

@ -80,6 +80,17 @@ local function vbar(args)
end end
end end
-- change bar color
---@param fg_bg cpair new bar colors
function e.recolor(fg_bg)
fgd = util.strrep(fg_bg.blit_fgd, e.frame.w)
bkg = util.strrep(fg_bg.blit_bkg, e.frame.w)
-- re-draw
last_num_bars = 0
e.on_update(e.value)
end
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
return e.get() return e.get()