naming conventions act 2: the end

This commit is contained in:
lustlion
2022-03-06 09:35:45 +01:00
parent edd064c2fd
commit 05bf757ea5
29 changed files with 509 additions and 536 deletions

View File

@@ -1,15 +1,15 @@
function HEX2RGB(color)
local r1 = HEX2DEX(color:sub(2,2))
local r2 = HEX2DEX(color:sub(3,3))
local g1 = HEX2DEX(color:sub(4,4))
local g2 = HEX2DEX(color:sub(5,5))
local b1 = HEX2DEX(color:sub(6,6))
local b2 = HEX2DEX(color:sub(7,7))
function hex2rgb(color)
local r1 = hex2dec(color:sub(2,2))
local r2 = hex2dec(color:sub(3,3))
local g1 = hex2dec(color:sub(4,4))
local g2 = hex2dec(color:sub(5,5))
local b1 = hex2dec(color:sub(6,6))
local b2 = hex2dec(color:sub(7,7))
return {(r1*16 + r2)/255, (g1*16 + g2)/255, (b1*16 + b2)/255}
end
function HEX2DEX(hex)
function hex2dec(hex)
if hex == "0" then return 0
elseif hex == "1" then return 1
elseif hex == "2" then return 2