This is simply one 10mm cube that I duplicated 8 times vertically, at same XY, but incremented the Z location by 10 each time. Then I imported all 8 stl's into Slic3r and saved it as this AMF file. So when you bring it into Repetier or another 3d printer controlling software, you can assign different colors to the different objects within this group. You can also delete cube 8, 7 , 6 etc if you want to make a shorter stick, as seen in photo.
Or you can scale this group either to make real short but still 10x10 in the XY, to let you create real thin layers of color like the photo of the rainbow cube. I scaled 0.6 in the X and Y and 0.8 in the Z for most of those color sticks to speed up the print.
You can see that I used it to test my color output from my DiamondHotend. I am using RYB (Red Yellow Blue) color combination, which means I don't have the full gamut of colors that a CYM (cyan yellow magenta ) would give. I am simply using the filament I have for now, I'll move to CYM later, as it looks like CYM gives a slightly fuller spectrum.
So bring this into Repetier and you'll see that if you have at least 8 virtual extruders, you can assign 8 different colors to the objects in this group.
If this all is confusing check out this http://www.reprap.org/wiki/Repetier_Color_Mixing
Bottom line is I used Blender to create a 10mm cube, and saved it off 8 times at different heights as .stl. Then I imported all 8 into Slic3r , and from there saved as this AMF.
If you have repetier installed, you already have Slic3r, just you need to go create a launch shortcut for it.