ID:2065294
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.

The ability to exclude 1 or more colors from the blend process of icons -OR- the ability to split up RGB components into a list via number(or other methods to support various colors) so that I can alter the values independently.

P.S.
I'm aware that there is a version of the latter floating around the dev > lib area.
The former can be done via MapColors() or possibly SwapColor(), depending on what you want. That would be a DM language thing rather than a Dream Maker thing, though.
I think he's looking for the ability to pass a series of colors via a list to SwapColor() a bunch of colors all in one instruction moreso than apply a color matrix to the output.

I'm thinking more or less what he's trying to do is say you have a white jumpsuit with a black belt. He seems to want to be able to change the color of the belt and the jumpsuit independently.

At least that's what I got out of his request. I'm sure he could clarify it more clearly though, but I think I see what he's getting at.
Being able to do that in one shot would be helpful, to be sure, although I don't think I could justify hard-coding it. As a possible workaround, maybe this:

// colors is an associative list
// e.g., colors[original] = custom
#define SWAP_COLOR "#12345678" // a color presumably no one would use
icon/proc/SwapMultiColors(list/colors)
var/a,b
var/list/L = new
for(a in colors) L[a] = colors[a] // Copy() doesn't always handle associations nicely
while(L.len)
a = L[L.len]; b = L[a]; --L.len
if(a == b) continue
if(L[b]) // if the target color is one we'll use later
L[SWAP_COLOR] = L[b]
L -= b
SwapColor(b, SWAP_COLOR)
SwapColor(a, b)