Preheat the oven to 180°C (Gas mark 4/350°F). Line a 12 hole muffin tin with 12 muffin cases.
Place the butter or dairy free spread into a mixing bowl and whisk together with the caster sugar until light and fluffy. Break the eggs into a bowl and lightly whisk with a fork. Add the eggs a little at a time to the butter and sugar mix, whisking in between.
Sift the flour on top, and using an electric whisk on a low speed, gently blend the ingredients together. Add the milk and vanilla extract and blend again. Increase the mixer speed and whisk for a few more seconds until well mixed.
Working quickly, split the cake mixture between as many small bowls as you have colours of food colouring. I used 4 colours; blue, green, yellow and red, so divided my cake mixture into 4.
Add gel food colouring and stir in to colour each of the bowls of cake mix.
Divide the cake mixture between the muffin cups, spooning some of each colour into each cup. Don't worry about being neat, just dollop it in!
Use a cocktail stick to blend the colours a little - not too much or the colours will merge - just a couple of times around the mixture in each muffin case.
Bake in the oven for 20-25 minutes until risen and springy to the touch.
Once the cupcakes are cooked, transfer to a wire rack to cool.
Whilst the cakes are cooling, make the buttercream icing. Whisk the butter with an electric whisk until light and fluffy. Sift in the icing sugar, a little at a time, until completely combined. Add the vanilla extract and whisk again. Add the milk in small splashes until the icing is at the correct consistency for piping.
Once completely cool, pipe a swirl of buttercream on each cupcake.
Decorate with rainbow sprinkles and rainbow cake toppers if using.