1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-12 19:20:29 +00:00

Added checks to window.setTextColor and window.setBackgroundColor

This commit is contained in:
Daniel Ratcliffe 2017-05-16 19:23:03 +01:00
parent 7f365c5102
commit 8c4331d15a

View File

@ -270,6 +270,11 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
end
local function setTextColor( color )
if type(color) ~= "number" then
error( "Expected number", 3 )
elseif tHex[color] == nil then
error( "Invalid color", 3 )
end
nTextColor = color
if bVisible then
updateCursorColor()
@ -312,6 +317,11 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
window.getPaletteColor = window.getPaletteColour
local function setBackgroundColor( color )
if type(color) ~= "number" then
error( "Expected number", 3 )
elseif tHex[color] == nil then
error( "Invalid color", 3 )
end
nBackgroundColor = color
end