Очень важный фикс

This commit is contained in:
Igor Timofeev 2017-08-06 16:26:23 +03:00
parent 41eac5ba55
commit 99ff32802d
2 changed files with 11 additions and 7 deletions

View File

@ -274,7 +274,7 @@
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/color.lua",
type="Library",
preloadFile=true,
version=1.07,
version=1.08,
},
{
path="/lib/ImageFormatModules/OCIF.lua",

View File

@ -7,13 +7,17 @@ local color = {}
-- Yoba-fix for PIDORS
if computer.getArchitecture and computer.getArchitecture() == "Lua 5.3" then
color.RGBToHEX = function(r, g, b)
return (r // 1 << 16) | (g // 1 << 8) | b // 1
end
color.RGBToHEX = load([[
return function(r, g, b)
return (r // 1 << 16) | (g // 1 << 8) | b // 1
end
]])()
else
color.RGBToHEX = function(r, g, b)
return bit32.lshift(r, 16) + bit32.lshift(g, 8) + b
end
color.RGBToHEX = load([[
return function(r, g, b)
return bit32.bor(bit32.bor(bit32.lshift(r, 16), bit32.lshift(g, 8)), b)
end
]])()
end
function color.HEXToRGB(HEXColor)