-- d0b d0b -- 00P d0P d0P ?00 -- d00 d000000Pd000000P 00b --?00,.d00b, d000b0b 000 d0000b ?00' ?00' d0000b 000000b d0000b?00, 00P --`?00' ?00d0P' ?00 ?00 d0b_,dP 00P 00P d0b_,dP 00P `?0bd0b_,dP `?0bd0P' -- 00b d0P00b ,00b 00b 00b 00b 00b 00b d00 00P00b d0P?0b, -- 000000P'`?00P'`00b 00b`?000P' `?0b `?0b `?000P' d00' 00b`?000P'd0P' `?0b -- 00P' -- d00 by creamy.eth -- ?0P (x.com/uwucreamy) -- Create dialog local dlg = Dialog{ title = "Palette Hex" } local hexInput = "" dlg :label{ text="Paste hex codes (comma-separated)" } :entry{ id="hexes", text=hexInput } :button{ text="Import", onclick=function() local input = dlg.data.hexes or "" local hexList = {} -- Extract valid hex codes for hex in input:gmatch("#?%x%x%x%x%x%x") do hex = hex:gsub("#", "") -- Remove leading '#' if any local r = tonumber(hex:sub(1,2), 16) local g = tonumber(hex:sub(3,4), 16) local b = tonumber(hex:sub(5,6), 16) table.insert(hexList, Color{ r=r, g=g, b=b }) end if #hexList == 0 then app.alert("No valid hex codes found.") return end -- Apply to active sprite local sprite = app.activeSprite if not sprite then app.alert("No active sprite.") return end -- Create new palette and assign colors local newPal = Palette(#hexList) for i, c in ipairs(hexList) do newPal:setColor(i-1, c) end sprite:setPalette(newPal) app.refresh() dlg:close() end } :button{ text="Cancel", onclick=function() dlg:close() end } :show()