Preheat your oven to 350°F (175°C) and line a 12-cup muffin tin with paper liners. Set aside.
In a medium bowl, whisk together the flour, baking powder, and salt until evenly combined. Set aside.
In a large bowl, beat the softened butter and sugar together with an electric mixer on medium speed for 3-4 minutes until light and fluffy. The mixture should look pale and have a whipped texture.
Add the eggs one at a time, beating well after each addition. Mix in the vanilla extract until fully incorporated.
Alternate adding the flour mixture and milk to the butter mixture, beginning and ending with flour (flour-milk-flour). Mix on low speed just until combined after each addition, being careful not to overmix.
Divide the batter evenly among 6 small bowls (about 1/4 cup each). Add a different gel food coloring to each bowl and gently stir until the color is just incorporated — about 10 stirs per bowl.
Spoon small dollops of each colored batter into the prepared cupcake liners, alternating colors and layering them randomly. Fill each liner about 2/3 full. Gently tap the pan on the counter twice to release air bubbles.
Use a toothpick to create a swirl pattern by drawing a figure-eight motion through the colors once or twice — don't overdo it or the colors will muddy together.
Bake for 18-20 minutes until a toothpick inserted in the center comes out clean and the tops spring back when lightly touched. The cupcakes should be lightly golden on top.
Cool in the pan for 5 minutes, then transfer to a wire rack to cool completely before frosting. Once cool, frost with vanilla buttercream and top with rainbow sprinkles.