function checks a string for a valid color value in hexadecimal format. it may also contain # as first character Source: core/String.js, line 135