#63 cleanup and assertions

This commit is contained in:
Mikayla Fischler
2022-06-11 17:06:32 -04:00
parent 4488a0594f
commit 89437b2be9
12 changed files with 46 additions and 23 deletions

View File

@@ -16,11 +16,13 @@ local element = require("graphics.element")
---@field x? integer 1 if omitted
---@field y? integer 1 if omitted
---@field height? integer 1 if omitted, must be an odd number
---@field fg_bg cpair foreground/background colors
---@field fg_bg? cpair foreground/background colors
-- new state indicator
---@param args state_indicator_args
local function state_indicator(args)
assert(type(args.states) == "table", "graphics.elements.indicator_state: states is a required field")
-- determine height
if util.is_int(args.height) then
assert(args.height % 2 == 1, "graphics.elements.indicator_state: height should be an odd number")