From 491f5ad3ccbb952532643d9ec430f0486f3c5655 Mon Sep 17 00:00:00 2001 From: 20kdc Date: Sun, 15 Apr 2018 23:21:05 +0100 Subject: [PATCH] Update logo and app-klogo slightly to work fine on monochrome monitors. --- code/apps/app-klogo.lua | 17 +++++++++++++---- code/data/app-klogo/logo.bmp | Bin 2598 -> 2598 bytes 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/code/apps/app-klogo.lua b/code/apps/app-klogo.lua index 824d25a..7f8ef18 100644 --- a/code/apps/app-klogo.lua +++ b/code/apps/app-klogo.lua @@ -60,11 +60,20 @@ lcWidth = bitmap.dsSpan local running = true -local function decodeRGB(rgb, igp) +local function decodeRGB(rgb, igp, col) if igp and bitmap.bpp > 24 then rgb = math.floor(rgb / 256) end - return math.floor(rgb / 65536) % 256, math.floor(rgb / 256) % 256, rgb % 256 + local r, g, b = math.floor(rgb / 65536) % 256, math.floor(rgb / 256) % 256, rgb % 256 + -- the new KittenOS NEO logo is 'sensitive' to dithering, so disable it + if not col then + -- ...and the palette is a bit odd, oh well + if math.max(r, g, b) < 0xC0 then + return 0, 0, 0 + end + return 255, 255, 255 + end + return r, g, b end local bW, bH = math.ceil(bitmap.width / 2), math.ceil(bitmap.height / 4) @@ -74,9 +83,9 @@ local fp = neoux.tcwindow(bW, bH, { selectable = true, get = function (window, x, y, bg, fg, selected, colour) if bitmap.ignoresPalette then - return decodeRGB(bitmap.getPixel(x - 1, y - 1, 0), true) + return decodeRGB(bitmap.getPixel(x - 1, y - 1, 0), true, colour) end - return decodeRGB(bitmap.getPalette(bitmap.getPixel(x - 1, y - 1, 0)), false) + return decodeRGB(bitmap.getPalette(bitmap.getPixel(x - 1, y - 1, 0)), false, colour) end }, 1) }, function (w) diff --git a/code/data/app-klogo/logo.bmp b/code/data/app-klogo/logo.bmp index 3ae158727d2c02d45bf1efc8fa1238b9f8eef5a6..1186b2fbb87a221f357cf4ea2b07e62d5c511c2f 100644 GIT binary patch delta 164 zcmZ1`vP@)xIU~bF3oYjV|Nl>Z$db76SS0J@2dtWtH?VO|zQ?K!rd!#}CO-s=aWFG5 zFid{WX28fWS%KY%1;}Hc9L8?M$Ub>5yYl2U>;hnxAw=R6yCFMB1rSV*;}DT l7tLYF!U-~FB8U29c}{MykrO!#SU7>AKtVV|b8;Bx1puZ(DTDw3 delta 170 zcmZ1`vP@)xIV00V3oYi~|NcyV$db76SR^YW)8vP&8k0A$aWb(mO@6?t31UueWitax zG=e2Km>C!tC%kC;KG~5&5~wel!;poYfq`lAL=N@I@|;{OEDQ_`K#n0ZkO8JSnLxDW