There is no direct way. So you either have to set some objects color and retrieve it (locking the screen). Or you have to construct an array or lookup table in advance and store this somewhere. The former works fine even if "ugly".