You can use HSL. & Since your colors have all kinda the same brightness & luminosity, you only have to lerp the Hue.
But, i have no idea how you gonna end up with the same color as the background colors, that way.
The Hue is more like a clock.. Its units are rather in degrees on a color wheel. Should be.
A hue of zero degrees color should be red. 60 degrees should be yellow. 120 should be green. 240 should be blue. 360 should be red again. This also means that if you change the hue from 240 to zero, you see the color change from blue, over green, over yellow, till it is red.
But, we talk about an effect. An effect is changing the existing sprite (its existing color).
So, the color is actually 'the existing hue of the sprite, as made in the sprite editor' + 'the hue in effect'.
Again, should be.
This would mean that ...
If the sprite = blue
... the resulting color = hue for blue + hue in effect ..
the resulting color for hue for blue + 360 should be blue again.
And that is not happening at all, test it and you will see.
If you start with a blue sprite, and set the hue in the effect to 360, the resulting color is close to black.
And that should for sure not happen, because that comes down to a change in the luminosity.
Besides that. I dont understand the units for the hue in the effect.
If you start with a red sprite, a hue of 30 gives already green as the resulting color.
That should be (if hue is in degree units as used every where else, virtual everywhere else) red sprite + 120 as value in the effect.
Now lets assume that 360 is scaled to 100. Or 100% = 360 degrees. This is done a lot in the effects.
Then, starting from red ... green = a 33 hue in the effect. Okay, that seems to hold.
But, then staring from red, a hue of 100 should give red again. Again. This is not happening.
So the last 20 % of the range 0 to 100 % for the hue value is completely useless.
I have the problem with luminosity. It is an effect. So the resulting luminosity = the existing luminosity *+-%/ the luminosity value in the effect. I just did not figure out this operator (*+-%/) yet. I have really no idea !
So excuse me for not being a big help.
Nevertheless, lets do it.
https://www.dropbox.com/s/0mybm78ildju2 ... .capx?dl=0
Same thing, but now with HSL.
Notice 3 things.
1/ the starting values for the 'dude' can not be 0,0,0. They must kinda match red. The color we start the 'dude' with.
2 / I never get those nice pastel colors matched. Because i dont understand the luminosity values. Mayby you can. My understanding of color wheels dont match at all with this concept for luminosity.
3 / purple is out of the box, because its matching hue value is bigger then 80. So its somewhere in the complete useless range hue = 80 - 100 %
Hope this helped you, it did not help me, because i had to dive into this HSL effect that hate from my toes up into the unlimited sky.