1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-10 20:09:58 +00:00

Merge pull request #381 from Wilma456/colerror

Better Error for "Invalid color"
This commit is contained in:
Daniel Ratcliffe 2017-07-25 19:56:59 +01:00 committed by GitHub
commit 94613d28a6

View File

@ -274,7 +274,7 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
if type( color ) ~= "number" then if type( color ) ~= "number" then
error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 )
elseif tHex[color] == nil then elseif tHex[color] == nil then
error( "Invalid color", 2 ) error( "Invalid color (got " .. color .. ")" , 2 )
end end
nTextColor = color nTextColor = color
if bVisible then if bVisible then
@ -321,7 +321,7 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
if type( color ) ~= "number" then if type( color ) ~= "number" then
error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 ) error( "bad argument #1 (expected number, got " .. type( color ) .. ")", 2 )
elseif tHex[color] == nil then elseif tHex[color] == nil then
error( "Invalid color", 3 ) error( "Invalid color (got " .. color .. ")", 2 )
end end
nBackgroundColor = color nBackgroundColor = color
end end