My example is very simple and I think that it will be very usefull for you.
An example can be view send_color” is the decimal number for the color that will be changed. The funcyion will return “new_hex_color” that is the decimal number converted to hexadecimal.
I created a sprite “box” where I draw 2 shapes. Each new hexadecimal code will be applied as a rgb color for that sprite.
The sintax is colorObject.setRGB(0xRRGGBB); 0xRRGGBB; defines either the hexadecimal or Red/Green/Blue color to be set. RR, GG, and BB need to be two hexidecimal digits each. 0x tells the script that the number is hexidecimal.