MapGen: add load fixColor to mapgen async

This commit is contained in:
Van
2026-01-14 21:11:17 +03:00
parent 907230e67d
commit c2b0c54236
3 changed files with 21 additions and 19 deletions

View File

@@ -3,23 +3,5 @@ Smc = {}
local modInfo = Mod.getInfo('smc__system__helper_lib')
local require = modInfo.require
---Converts a colorstring into a single representation so that similar colors can match.
---@param color ColorString
---@return ColorString
function Smc.fixColorString(color)
local colorTable = core.colorspec_to_table(color)
if colorTable == nil then
return ''
end
local colorString = core.colorspec_to_colorstring(colorTable)
if colorString == nil then
return ''
end
return colorString
end
require('Lib.globalStep')
require('Lib.color')

View File

@@ -0,0 +1,18 @@
---Converts a colorstring into a single representation so that similar colors can match.
---@param color ColorString
---@return ColorString
function Smc.fixColorString(color)
local colorTable = core.colorspec_to_table(color)
if colorTable == nil then
return ''
end
local colorString = core.colorspec_to_colorstring(colorTable)
if colorString == nil then
return ''
end
return colorString
end