fix: commit progress.lua

This commit is contained in:
2025-11-29 14:41:13 +01:00
parent 513d27c6c9
commit 595c4e6fcc

12
src/lib/progress.lua Normal file
View File

@@ -0,0 +1,12 @@
local utils = require("utils")
local progress = {}
function progress.bar(x, y, width, value, max, fg, bg)
local fgWidth = utils.round(value * width / max)
fgWidth = math.max(0, math.min(width, fgWidth))
paintutils.drawLine(x, y, x + width - 1, y, bg)
paintutils.drawLine(x, y, x + fgWidth - 1, y, fg)
term.setBackgroundColor(colors.black)
end
return progress