Two weighings suffice. Weigh one red and one white ball against one blue and the other white ball. If the weights are equal, then the red and the blue differ in weight. A weighing between these two balls allows us to deduce the weights of all other balls. If the red-white combination was heavier than the blue-white combination in the first weighing, then the white ball in the red-white combination is certainly heavy and the other white is light. Now take the red from the red-white combination and the blue from the blue-white combination. Weigh these together against the remaining red and the remaining blue. The only interesting case is when this weighing is "equal". Then, the red from the red-white combination must be heavy and the blue from the blue-white combination must be light.
Many approaches to this puzzle are described here.