Problem with converting variable types & serial communication

The problem with the third number is that you only store a number when it is followed by a comma:

      if(inChar==','){
        inColor[currentColor] = serialBuffer.toInt();
        currentColor++;
        serialBuffer = ""; 
      }