1
0

Code-quality
All checks were successful
Lua Library / Lua-Testing (push) Successful in 5s
Lua Library / Static-Analysis (push) Successful in 3s

This commit is contained in:
Jon Michael Aanes 2024-04-26 14:22:23 +02:00
parent cdd7b6af09
commit 3e69350acd

View File

@ -13,7 +13,7 @@ local function get_palette_of_image_data (data)
-- --
for x = 0, data:getWidth() - 1 do for x = 0, data:getWidth() - 1 do
for y = 0, data:getHeight() - 1 do for y = 0, data:getHeight() - 1 do
local r, g, b = data:getPixel(x, y) local r, g, b, a = data:getPixel(x, y)
if not has_seen[r] then has_seen[r] = {} end if not has_seen[r] then has_seen[r] = {} end
if not has_seen[r][g] then has_seen[r][g] = {} end if not has_seen[r][g] then has_seen[r][g] = {} end
if not has_seen[r][g][b] then if not has_seen[r][g][b] then
@ -52,7 +52,7 @@ local function apply_change_palette (data, change_palette)
assert(change_palette) assert(change_palette)
-- --
local change_tree = change_palette_to_dim_tree(change_palette) local change_tree = change_palette_to_dim_tree(change_palette)
local function map (x, y, r, g, b, a) local function map (_x, _y, r, g, b, a)
local c = change_tree[r][g][b] local c = change_tree[r][g][b]
return c[1], c[2], c[3], a return c[1], c[2], c[3], a
end end