Page 1 of 1

colorSwap - recoloring NES sprites was painful

Posted: Wed Feb 26, 2025 8:09 pm
by Lusho
This is a small script I wrote to change the color of the outlines on NES sprites, though it works to replace any color with any other
Beware transparency and screen effects of course, Also I don't know how well this will work on multiplayer.

Preview (Flashy Colors Warning?):
Spoiler: show
Image
Image

How to use:
Spoiler: show
on a luna.lua file, put this line:

Code: Select all

local colorSwap = require("scripts/colorSwap")
Then you have these two functions to use, you call them from the function onCameraDraw(camIdx):

Code: Select all

-- To replace a color use:
colorSwap.replaceColor(camIdx, priority, replacedColor, replacingColor)

-- This one is similar, but you provide a table of the color for each section, so it changes automatically.
-- You also provide a default color incase the color of the section isn't found.
colorSwap.replaceColorFromSection(camIdx, priority, replacedColor, replacingColorTable, defaultColor)

Download:
https://drive.google.com/file/d/1JX74P0 ... sp=sharing
(found issue with multiplayer, so I uploaded the hopefully fixed script now)

Re: colorSwap - recoloring NES sprites was painful

Posted: Fri Jun 20, 2025 12:07 am
by SuperMachoBros
Hello, and sorry for the question, im a bit slow, but how exactly does it work? what should i change, and how should i change it? could you please provide an example in real time?