From 8bdb3d301080c330ce070b91f05c7d3800ce7835 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Tue, 3 Apr 2018 18:29:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D1=8F=D1=83,=20=D0=BE=D1=85=20=D1=83?= =?UTF-8?q?=D0=B6=20=D1=8D=D1=82=D0=B0=20=D0=AF=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/color.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/color.lua b/lib/color.lua index a8a168be..08c33b39 100755 --- a/lib/color.lua +++ b/lib/color.lua @@ -17,7 +17,9 @@ if computer.getArchitecture and computer.getArchitecture() == "Lua 5.3" then ]])() else IntegerToRGB = function(IntegerColor) - return bit32Rshift(IntegerColor, 16), bit32Band(bit32Rshift(IntegerColor, 8), 0xFF), bit32Band(IntegerColor, 0xFF) + local r = mathFloor(IntegerColor / 0x10000) + local g = mathFloor((IntegerColor - r * 0x10000) / 0x100) + return r, g, IntegerColor - r * 0x10000 - g * 0x100 end end