summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--img/better_disp.lua8
1 files changed, 1 insertions, 7 deletions
diff --git a/img/better_disp.lua b/img/better_disp.lua
index 4ded7fd..ab340de 100644
--- a/img/better_disp.lua
+++ b/img/better_disp.lua
@@ -55,7 +55,6 @@ local function adjust_to_2_colors(R,gromlings,pdists)
local gromling_colors = {}
for i,c in ipairs(gromlings) do
local cx = disp_common.closest_palette_color(R,c)
- print("boo",i,c,cx)
gromling_colors[i] = cx
end
@@ -66,23 +65,17 @@ local function adjust_to_2_colors(R,gromlings,pdists)
all_current_colors[cidx] = true
end
- print(ncolors)
-
while ncolors > 2 do
- print(ncolors)
-- merge closest two colors until there are only 2 distinct ones left
local best_dist = 9999
local best_a = nil
local best_b = nil
for a in pairs(all_current_colors) do
- print("a is "..a)
for b in pairs(all_current_colors) do
- print("b is "..b)
if a ~= b then
local dist = pdists[a][b]
assert(dist)
if dist < best_dist then
- print("yeah")
best_dist = dist
best_a = a
best_b = b
@@ -162,6 +155,7 @@ local function disp(R,img,scrx,scry,w,h,imgx,imgy)
end
local lCx_gromlings = adjust_to_2_colors(R,lPx_gromlings,pdists)
+ for k,v in ipairs(lCx_gromlings) do print("thethe",k,v) end
local textc,bgc,vlorbchar = vlorb(gromling_list_to_vlorb(lCx_gromlings))
R.setTextColor(textc)
R.setBackgroundColor(bgc)