Preheat the oven to 350°F. Line cupcake tins with wrappers.
In a medium bowl, sift together the flour, baking powder and salt.
In the bowl of a stand mixer fitted with the paddle attachment, cream together the butter and sugar until light and fluffy. Add the eggs, one at a time, mixing between each addition then add the vanilla and mix until combined.
Alternately add the flour mixture and milk to the stand mixer in three increments each, beginning and ending with the flour mixture and beating between each addition. Divide the batter into six bowls then dye each with the red, orange, yellow, green, blue and purple food coloring.
Spoon a portion of the purple batter into each cupcake cup, top it with the blue, then green, yellow, orange and red, careful not to mix any of the layers. (Alternately, transfer each color into sealable plastic bags and pipe the batter into the cups.) Bake the cupcakes for 15 to 18 minutes until a toothpick inserted comes out clean. Remove the cupcakes from the oven and transfer them to a rack to cool completely while you make the frosting.