Processing JMyrom ColorTracker - cant find my error

  for(int i=0;i<a.length;i++)

Your test for a.length == 0 in this for loop is in the wrong place. The code will never be executed, if a.length is 0, because the whole for loop will be skipped.