There are 24 orientations of the cube. From any orientation, the other 23 can be generated by rotations, which can be categorized as follows:
- 3 axes passing through opposite faces; for each axis, 90 degrees clockwise, 90 degrees counterclockwise, or 180 degrees. (9 total)
- 6 axes passing through opposite edges; for each axis, 180 degrees. (6 total)
- 4 axes passing through opposite vertices; for each axis, 120 degrees clockwise or 120 degrees counterclockwise. (8 total)
We start by building all possible cubes that use all three colors. The number of these is $3^8-3\cdot2^8+3=5796$. Then, if any two cubes can be converted to each other by a rotation, we put them in a set together. We want to find the number of sets.
If no rotation brings a cube to an identical one, then it is in a set of 24. However, if a cube is the same under some rotation, it is in a set of fewer than 24. We need to determine how many cubes are in smaller sets, and what the size of those sets is. Thankfully, no cube that has multiple rotational symmetries around different axes uses all three colors, so we can ignore the possibility of multiple rotational symmetries. Also, no cube that remains the same under a 90-degree rotation uses all three colors. We only need to consider the 180-degree rotations and the 120-degree rotations.
There are 9 possible 180-degree rotations. For each one, a cube that remains the same under that rotation is defined by the colors of four subcubes, so there are $3^4-3\cdot2^4+3=36$ for each of the nine rotations. This is a total of $324$ cubes, which are in sets of 12.
There are 8 possible 120-degree rotations, but they come in clockwise-counterclockwise pairs. For each pair, a cube that remains the same under those rotations is also defined by the colors of four subcubes, so there are $36$ for each of the four pairs. This makes $144$ cubes, which are in sets of 8.
The remaining $5796-324-144=5328$ cubes are in sets of 24. The total number of sets is $\frac{324}{12}+\frac{144}{8}+\frac{5328}{24}=267$. Then we add the $23\cdot3-3=66$ cubes using at most two colors for a total of $\boxed{333}$.