Is it good enough for you if the set of different colors are hard-coded in the module? If yes, it is not too difficult.
If no, I could imagine a couple of possibilities which look either difficult or impossible, but here they are
- One could put a js to modify the css according to the productId. The problem here is I don't know how to feed the productId into js.
- One could let the module write css files, let's say, when module parameter gets set up. One of he difficulties is, I don't know if there is a "X-cart" way of writing a file. But after all, a php code is a php code, so this should be possible. But then, the second problem is, is the path to module css files writable by http server?