private static boolean missingHashColorFormat(String colStr){
  int len=colStr.length();
  if (len == 3 || len == 6) {
    String match="[0-9a-f]{" + len + "}";
    return colStr.matches(match);
  }
  return false;
}

private static boolean missingHashColorFormat ( String colStr ) { int len = colStr . length ( ) ; if ( len == 3 || len == 6 ) { String match = "[0-9a-f]{" + len + "}" ; return colStr . matches ( match ) ; } return false ; }
a web color string without the leading # will be 3 or 6 characters long and all those characters will be hex digits . note : colstr must be all lower case or the current hex letter test will fail .
