Cycle through rainbow colors for recolorizer?


I’m working on a POC where I test the recolorizer extension, as well as cycling through rainbow colors (It would work better in a function, but since this is just for testing, I’m just using normal events)

So I have this very developer art looking sword here, and I would like for the blade to cycle through rainbow colors. Not only that, I’d like to keep it restricted to bright, pastel-y colors too:

So, here’s my code:

Note how I use 207 instead of 0 to get the pastel colors
The colors ARE in fact changing, but they’re not changing correctly, they still used the normal oversaturated colors, they blink from the previous color to the new color, and the wrong colors are often displayed, such as green showing when it shouldn’t…

Also, it lags the game REALLY hard

I’m using RGB here, am I using the wrong thing? Should I be using HSL or something instead?

Is there something better I can do to improve upon this? Thanks in advance

I don’t think recolouriser is designed to be run constantly. If I understand it correctly, it changes the pixels in the image.

And RGB isn’t the best way to cycle through colours. Use HSV/HSL, it will be much better suited for what you want to do. There is an extension to convert HSV to RGB too

I’d suggest you split your image into 2 - one for the sword’s handle and cross guard, the one for the blade and glow along the cross guard. Make the blade and glow white (or shades of white), and just recolour that. And you can use the sticker extension to hold the 2 parts together on screen. It’ll be a lot more efficient and shouldn’t impact frame rate…

Alright, I’ve switched out RGB with HSL (I’m still using the recolorizer, just to confirm if it works in the meantime)

I’m using the conversion extension so that the recolorizer can read it, and I have another issue now…
The sword’s blade now shows white, and doesn’t cycle colors at all. Is there something I need to add or remove?

I’ll take into account what you said about the lag, but for now, I just want to make sure the color cycling works, thanks

I think that once you change the colour using recolouriser, the colour you are testing for will no longer exist on that sprite.

Change the sprite colour using tint instead.

Ahh, alright, I can do that

Unfortunately, this still isn’t working, even with the conversion to RGB. The sword now doesn’t chance any color at all

  1. Make the sword two separated objects (what you want to change color, and what you dont)

  2. In any image editor make the part you want to change color grayscale (but keep it mostly white-ish!)

  3. At the beginning of scene change tint to red so it already starts colored.

  4. The “complicated” part is just that you will have to setup a loop with 7 tween HSL color events (one for each color of the rainbow)

Use HSV to RGB, with maximum S and V values. These are my events:

And this is the result:



Hey, this is great, it’s nice and compact too!
I wouldn’t have thought of using tweens, altho, I can see why they’re much more performant.
Just one last thing, is there a way to make sure whites STAY white? Basically things like greys being changed, with white being ignored, to give the effect an additive glow.
Will I just have to use the blend modes bundled in, or attach the white part as a separate object?

White is literally the best color to use along with tint color, if you don’t want it to change, you should make it two separated objects.

Thank you, you two have been very helpful, this information will be valuable for me later!

That’s 2 sages offering the same advice :smiley: