How to convert ColorType property to RGB in PilotScript

I'm trying to convert a (global) property of type ColorType to its component red, green and blue values. It seems the ColorType property is really a String (at least when examined in PilotScript); either a name, e.g. "red", or hex representation, e.g. "0xFF0000". I can convert the latter in Pilotscript but colour names will be a challenge.

Please advise how this can be done.

Thanks,
Chris.