HelperLib: create fixColorString method

This commit is contained in:
Van
2026-01-14 16:54:06 +03:00
parent 18dbce95c0
commit 3d0a906a59

View File

@@ -3,4 +3,23 @@ Smc = {}
local modInfo = Mod.getInfo('smc__system__helper_lib') local modInfo = Mod.getInfo('smc__system__helper_lib')
local require = modInfo.require 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.globalStep')