There isn't currently a way for scripts to change the color of an image. However, the GUI engine does allow "special" sprites to be defined at run-time. Currently only stretched images are supported, so I've modified this to add support for solid color sprites. This is useful for among other things, player colors, which may change from one game to the next, thus eliminating the need to hardcode N number of sprites ahead of time.
Example usage:
// Get an image object from the GUI
var imageObject = getGUIObjectByName("colourThing");
imageObject.sprite = "colour: 255 0 0 200"; // RGBA
The colour is specified in integer RGBA format like other GUI objects (0-255).
This should be useful for any GUI object with a sprite property.
One caveat as Philip notes, is that the sprite will be stored based on its name so every time a new sprite is created like this, it will be cached separately if even one character is different (even if it would appear identical).
(In [8431]) Add special "colour:r g b a" sprite syntax to GUI. Fixes #616, based on patch from historic_bruno.