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:
commit
94613d28a6
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user