Any way to create animations programmatically?

Hello. I know this might sound like an odd request, but I have several objects (sprites) being used basically as buttons. And they all have a dozen or so animations, which are simply solid colored squares. Each of these separate objects (not instances, but unique objects) have the same “animations”.

My problem is, if I need to change the color of one of my simple colored animations, I need to update that in each separate object (again, not instances).

I was thinking if I had a table of hex codes (for the colors) and each object just created animations containing those hex colors, I could easily change all the colors by just changing the hex code in the table.

Can anyone think of a way to do this?


IDK if there is a way to do it the way you want to do it
Yet i believe there is a way to achieve effect which you describe

You can tint your buttons
IF you make them white you can tint them to any color

Yet if your buttons contain some elements that should not be tinted like text
Or signs or whatever else
You would need to break them to separate object

But this way instead of having one object for each button
You could only have one object (two if it contains text sign or whatever) and simply use it over and over with instance variables