Code-quality
This commit is contained in:
parent
cdd7b6af09
commit
3e69350acd
4
init.lua
4
init.lua
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user