I have to prepare an algorithm to solve the puzzle part of Dr. Eureka, a multiplayer game from Blue Orange Games. This is part of a research project that also involves computer vision and robotics. The game also involves agility and dexterity, but here I am looking for advice on the logic puzzle part only. Here is an image

In particular I need some advice on calculating the search space. There are three tubes and six balls of three different colors (two balls of each color). Up to four balls can be stacked inside each tube, in a specific order. All balls must be inside a tube, but each tube may hold four, three, two, one, or no balls. The order of the tubes may be rearranged (e.g. if tube A has balls green and red, and tube B has the purple ball, this is the same as if tube A had the purple ball and tube B had balls blue and red). Also, a tube may be flipped over, upside-down, so reversing the order also does not matter.

The number of possible solutions to a given game goal (to match the picture in the card) can be calculated as the sum of all permutations of balls of same colors (8 permutations of colors) times the possible flip-overs (8 permutations of flip-overs) times the possible order of the three tubes (6 permutations of order of tubes), resulting in 384 possible configurations.
I seek some advice on how to calculate the number of possible valid configuration states for this game.
I think you are in for careful counting. There are only five combinations of numbers of balls in tubes$-4+1+1,4+2+0,3+3+0,3+2+1,2+2+2$ If we take the $4+1+1$ case the two $1$s can be the same color or different. If they are the same there are $3$ choices for that color and three choices for how to stack the $4$-the colors can alternate or either of the two remaining colors can be on the ends, so that gives $9$ possibilities. If the two $1$s are different there are three ways to choose those two colors, and $6$ ways to order the $4$ balls because there are no symmetric arrangements, for $18$. Thus $4+1+1$ gives $27$ arrangements. Now do the other four the same way.