Colored balls are placed in a 4x4 grid. A move consists of swapping two adjacent (horizontally or vertically) balls. What is the least number of moves required to form 4 connected components*, one for each color in the following grid?
*Here a connected component is a collection of balls of the same color, such that there is a path of horizontal or vertical steps from any ball to any other ball.