mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
Fix mcl_util.get_color
This commit is contained in:
parent
09671b7ac9
commit
2125c51c9c
1 changed files with 2 additions and 3 deletions
|
@ -409,9 +409,8 @@ end
|
||||||
function mcl_util.get_color(colorstr)
|
function mcl_util.get_color(colorstr)
|
||||||
local mc_color = mcl_colors[colorstr:upper()]
|
local mc_color = mcl_colors[colorstr:upper()]
|
||||||
if mc_color then
|
if mc_color then
|
||||||
return mc_color
|
colorstr = mc_color
|
||||||
end
|
elseif #colorstr ~= 7 or colorstr:sub(1, 1) ~= "#"then
|
||||||
if #colorstr ~= 7 or colorstr:sub(1, 1) ~= "#"then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local hex = tonumber(colorstr:sub(2, 7), 16)
|
local hex = tonumber(colorstr:sub(2, 7), 16)
|
||||||
|
|
Loading…
Reference in a new issue