module refactor completion

This commit is contained in:
Michael Freno
2025-10-31 21:01:39 -04:00
parent d947bc04e4
commit 87526c34ec
9 changed files with 393 additions and 435 deletions

View File

@@ -4,9 +4,11 @@ Manages theme loading, registration, and component/color/font access.
Supports 9-patch images, component states, and dynamic theme switching.
]]
local Color = require("flexlove.Color")
local NinePatchParser = require("flexlove.NinePatchParser")
local ImageScaler = require("flexlove.ImageScaler")
local modulePath = (...):match("(.-)[^%.]+$")
local function req(name) return require(modulePath .. name) end
local NinePatchParser = req("NinePatchParser")
local ImageScaler = req("ImageScaler")
--- Standardized error message formatter
---@param module string -- Module name (e.g., "Color", "Theme", "Units")
@@ -490,4 +492,11 @@ function Theme.getColorOrDefault(colorName, fallback)
return fallback or Color.new(1, 1, 1, 1)
end
--- Get a theme by name
---@param themeName string -- Name of the theme
---@return Theme|nil -- Returns theme or nil if not found
function Theme.get(themeName)
return themes[themeName]
end
return Theme