Why not just do a pallet?
You can save the color as a number value using the formula: R+(G*256)+(B*65536)
It can go into a variable using int(tokenat()), or into an array as a stack.
Also:https://www.construct.net/en/make-games/addons/577/color-variable
I have not messed with it yet though.