Page 1 of 1

[EFFECT] Color Replace

PostPosted: Wed Aug 04, 2010 7:31 pm
by R0J0hound
What it does:
Replaces one color with another.

How to use it:
The "old" parameters define the color to be replaced, and the "new" parameters define the new color. Values are in the range from 0 to 255.

Download "Color Replace.fx" and place it inside the effects folder.

Color Replace.fx

New version that works with transparency, thanks to tulamide :D

Re: [EFFECT] Color Replace

PostPosted: Sat Sep 25, 2010 1:00 pm
by Azu
Awesome. Say, would it be possible to have it float4_int instead of 1?

Original Color | R,G,B
Replacement Color | R,G,B

In the event editor, you would have

Set Original Color
Set Replacement Color

Re: [EFFECT] Color Replace

PostPosted: Wed May 02, 2012 8:32 am
by blackarcadia
I only found this effect now and wanted to thank R0J0hound for it. I really needed a way to replace specific colors of sprites for my project instead of having multiple clones with different colors.

This will come in very handy.

Re: [EFFECT] Color Replace

PostPosted: Mon Dec 12, 2016 12:44 pm
by ezrubiera
It is just great, but I need to know how can I access the actual source color of a sprite to interpolate it between the source and the target, something like:

set effect parameter(0) to lerp(self.effect(ReplaceColor).RSource, self.effect(ReplaceColor).RTarget, time)