Skip to content

Commit

Permalink
Fix Bug with term.getPaletteColour()
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobDev committed Jul 30, 2017
1 parent 579f744 commit 1bef3f1
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -311,8 +311,12 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
window.setPaletteColor = window.setPaletteColour

function window.getPaletteColour( colour )
local tCol = tPalette[ colour ]
return tCol[1], tCol[2], tCol[3]
if type( colour ) ~= "number" then
error( "bad argument #1 (expected number, got " .. type( colour ) .. ")", 2 )
elseif tHex[colour] == nil then
error( "Invalid color (got " .. colour .. ")", 2 )
end
return parent.getPaletteColor( colour )
end

window.getPaletteColor = window.getPaletteColour
Expand Down

0 comments on commit 1bef3f1

Please sign in to comment.