code: public static final Color fromString(String value) {		
  		if(Strings.isValid(value)) {
  			Regex regex = new Regex(COLOR_REGEX, false);
  			if(regex.matches(value.trim())) {
  				int r = -1, g = -1, b = -1;
  				String[] matches = regex.getAllMatches(value).get(0);
  				if(matches[0] != null && matches[0].equals("#")) {
  					// this is an hex number, it can be #ABC or #AABBCC
  					if(matches[1].length() == 3) {
  						// it's #ABC, which must be parsed as AA BB CC
  						r = Integer.decode("0X" + matches[5] + matches[5]);
  						g = Integer.decode("0X" + matches[6] + matches[6]);
  						b = Integer.decode("0X" + matches[7] + matches[7]);						
  					} else if(matches[1].length() == 6) {
  						// it's #1A2B3C, parsed as 1A 2B 3C
  						r = Integer.decode("0X" + matches[2]);
  						g = Integer.decode("0X" + matches[3]);
  						b = Integer.decode("0X" + matches[4]);						
  					}
  				} else if(matches[8] != null && matches[8].equalsIgnoreCase("rgb")) {
  					// it's rgb(111,222,333)	
  					r = Integer.parseInt(matches[9]);
  					g = Integer.parseInt(matches[10]);
  					b = Integer.parseInt(matches[11]);						
  				}
  				if(0 <= r && r <= 255 && 0 <= g && g <= 255 && 0 <= b && b <= 255) {
  					return new Color(r, g, b);
  				}
  			}
  		}
  		return null;
  	}
docs: Parses an input string and returns the corresponding colour object.
  
  @param value
  the string, in "#(AB,CD,EF)" or "rgb(AB,CD,EF)" format.
  @return
  the {@code Color} object, or null.