Before you begin, ensure all your ingredients are at room temperature and that your workspace is set up for efficiency. Preheat your oven to 350°F (175°C) and line the baking pans with parchment paper, allowing a little overhang for easy removal later. You’ll need three separate pans to bake the layers.
In a big mixing bowl, beat the softened butter and sugar together until the mixture becomes smooth, pale, and airy. This will take about 3-4 minutes of beating on medium-high speed. The mixture should be pale and airy, creating a good foundation for your cookie layers.
Once the butter and sugar are creamed, add the egg yolks, one at a time, mixing well after each addition. Then, add the almond extract, vanilla extract, and a pinch of salt. These extracts give the cookies their signature almond flavor, which is the key to authentic Italian gluten-free rainbow cookies.
Gradually mix in the almond flour. This gluten-free flour substitute is essential for both flavor and texture, giving the cookies a rich, nutty undertone. Make sure to scrape down the sides of the bowl to ensure all ingredients are fully incorporated.
In a separate, clean bowl, whip the egg whites until soft peaks form. This step helps give the cookie layers a light, airy texture. Once whipped, gently fold the egg whites into the batter, being careful not to deflate them. This will ensure your gluten-free rainbow cookies have the perfect balance of lightness and structure.
Divide the batter evenly into three bowls. Add red food coloring to one bowl, green food coloring to another, and leave the third bowl plain for the yellow layer. Mix each bowl until the color is fully incorporated. For a more natural option, you can use plant-based food colorings made from beets and spinach.
Spread each colored batter into the prepared baking pans, smoothing out the tops with an offset spatula. The layers should be about ¼-inch thick. Bake each pan for 10-12 minutes, or until just set. Be careful not to overbake, as you want the layers to remain soft and chewy.
Once the layers are baked, allow them to cool completely in their pans. Once cool, gently lift the parchment paper and remove the layers from the pans. Place the green layer on a flat surface, spread a thin layer of strained apricot preserves over the top, and then place the plain yellow layer on top of that. Repeat the process with the red layer on top. Place a sheet of parchment paper on top of the stacked layers and weigh it down with a heavy book or pan. Let the layers set in the fridge for at least 4 hours or overnight.
While the layers chill, melt the dark chocolate in a microwave-safe bowl or over a double boiler. Once melted and smooth, let it cool slightly.
Remove the chilled layered cookies from the fridge and spread half of the melted chocolate over the top. Use an offset spatula to smooth it out. Place the layers back in the fridge for 10-15 minutes to set. Once the chocolate is firm, flip the layers over and coat the other side with the remaining chocolate. Chill again until the chocolate is fully set.