mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-12 11:10:29 +00:00
Added checks to window.setTextColor and window.setBackgroundColor
This commit is contained in:
parent
7f365c5102
commit
8c4331d15a
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user