The Identify Font Color chapter in the introduction to surface automation guide is all about what makes up the hex code.
Personally, I don't use the contains colour action any more. I just create an image with one or two pixels with the color I want and use the normal image search - find image action, with a tolerence set just in case there is an issue in the production desktop ui where exact colour matches cannot be trusted.