Make a white cake mix using the directions on the box
Evenly divide the cake mix into six bowls (for a full rainbow or you can always do more colors or less colors in your cake)
Add food coloring to your batter
Stir in the food coloring until completely mixed in. Add more food coloring until it is the color you want. Make sure to mix completely.
Spray two 8" cake pans really well. Take the first cake pan and add 2/3 of the batter around the very outside, do not add any to the middle of the cake pan.
Next add half the orange to the middle of the cake pan, but do not cover any of the red. Add half of the yellow right in the middle of the orange. Tap the cake pan gently on the counter until the batter is flat (no rounding in the middle). Add half the green right in the middle of the yellow. Tap the cake pan gently on the counter again until the batter is flat. Add half the blue, tap, add 1/3 of the purple, tap. Set aside the pan. Using the second cake pan. Add 2/3 of the purple around the outside, the blue in the middle, the green in the middle of the blue, tap, add the yellow, tap, add the orange, tap and add the red and tap. Add both cake pans and bake using the boxes directions.
Let cool for 10 minutes then turn out onto cooling racks. Let cool all the way before frosting.
I also made cupcakes. I colored the batter the same way. I sprayed a muffin pan really well (I didn't use papers). With the muffins I add purple first then worked my way up to red. This time I didn't try to get the layer perfect and just added color on top of color and tapped the whole pan at the end. Then I baked as directed. Let them cool for about 5 minuted and turned them out onto a cooling rack.
I used vanilla frosting between the two cakes and all over the outside and then decorated the whole outside with M&Ms.
I also used vanilla frosting on the cupcakes and dcorated with M&Ms.
Once you cut into the cake you can see the "layers" of color.