I started by preheating my oven to 350°F (175°C). I greased and lined two 8-inch round cake pans with baking paper.
I split the cake ingredients into three equal parts so I could bake two layers at a time. In a big bowl, I mixed 2 eggs, 130g sugar, 130g flour, 130g buttery spread, 1 tbsp baking powder, a pinch of salt, 1 tsp vanilla, and 1 tbsp milk.
I mixed everything with my hand mixer for about 2 minutes until the batter looked smooth and creamy.
Then I divided the batter into two bowls. I added purple food coloring to one and blue to the other. I poured them into the pans and spread them evenly.
I baked the first two layers for around 15 minutes. I pressed gently in the center to check if they were springy. Then I cooled them on a rack and got my pans ready for the next round.
I repeated the same process two more times with the other colors—green and yellow in the second batch, orange and red in the last.
While the cake layers cooled, I made the cream cheese frosting. I beat the softened butter and milk with half the confectioners’ sugar until smooth. Then I added the rest of the sugar, the cream cheese, and vanilla. I mixed until it looked fluffy and light.
Once the cakes were completely cool, I peeled off the parchment paper and got ready to build the rainbow. I placed the purple layer on the cake board and spread a little frosting on top.
I added each layer in this order: blue, green, yellow, orange, and red—spreading frosting between each.
After stacking, I covered the whole cake with a thin layer of frosting and popped it in the fridge for about 20 minutes to lock in the crumbs.
I took it out and added a final layer of frosting, smoothing it out nicely. Then I sprinkled colorful nonpareils on top.