Check whether a string is a hex color.