#344 graphics assertion overhaul

This commit is contained in:
Mikayla Fischler
2023-09-30 11:46:47 -04:00
parent ed4180a072
commit 625feb3fd1
31 changed files with 126 additions and 113 deletions

View File

@@ -23,11 +23,11 @@ local flasher = require("graphics.flasher")
---@param args indicator_light_args
---@return graphics_element element, element_id id
local function indicator_light(args)
assert(type(args.label) == "string", "indicators.light: label is a required field")
assert(type(args.colors) == "table", "indicators.light: colors is a required field")
element.assert(type(args.label) == "string", "label is a required field")
element.assert(type(args.colors) == "table", "colors is a required field")
if args.flash then
assert(util.is_int(args.period), "indicators.light: period is a required field if flash is enabled")
element.assert(util.is_int(args.period), "period is a required field if flash is enabled")
end
args.height = 1