This may be useful or not to test whether a given string is a valid (more or less) html color value. It matches color values such as:
Regex allows whitespaces between i.e. rgb and (, also between numbers and commas, but not in value like 55% between number and percentage. To change this behaviour simply remove \s*? from appriopriate places.