It's very simple to do.
I used a white cake mix so that my colors would turn out just the way I wanted them.
Make the cake batter exactly the way the box directions tell you to for two 9 inch round cake pans. Before pouring the batter into the prepped cake pans, divide it in half. Take some red food coloring and add just a few drops to one of the batters and mix-this will make you pink layer. Take blue food coloring and add just a few drops to the other batter half and mix. It's always best to add too little at first and mix and then add more coloring.
After you have your desired color of batter (I wanted pastels so it didn't take much) pour the batter into the prepared cake pans and bake according to box directions.
When they are fully baked and cooled, put the layered cake together like any other. I used white icing.
Here is what it looked like after the reveal.
For my son's 4th birthday he asked for rainbow cupcakes. I did not take pictures of the process but here is what it turned out looking like.
We all loved them and they were so yummy. My son definitely enjoyed them.
To make these lovely rainbow cupcakes all you have to do is prepare the cupcake batter per the box directions. Then decide what colors you want to use for your 'rainbow'. Divide the batter equally into bowls that coordinate per color. For example: if you want 5 colors in your 'rainbow' cupcakes then you will need 5 bowls, each filled with the same amount of cupcake batter. Use food coloring to make your desired colors. Just put a few drops of the preferred color into each bowl of batter and mix. Once you have your batter prepared to the color that you desire, just fill the cupcake tins. It works best to use measuring spoons or 1/4 C measuring cup to make sure the colors are around the same amount per cupcake. Simply layer the different colors in the cupcake tins and bake according to the package.
Don't worry about colors running and not turning out well. You can almost not mess this up. It also helps if after you fill all the tins with the first color of batter, to tap your tins to get the batter to settle evenly. Do this between each color that you add to the cupcake tins. I used white icing to top off my son's birthday cupcakes and they looked great!