Whisk the flour, baking powder and salt in a medium bowl. Beat the butter, granulated sugar and confectioners' sugar in a large bowl with a mixer on medium-high speed until light and fluffy, about 2 minutes. Beat in the egg yolks and vanilla until smooth. Reduce the mixer speed to medium low and gradually beat in the flour mixture until the dough just comes together.
Divide the dough into 6 pieces: 2 large pieces (about 7 ounces each), 2 medium pieces (about 5 ounces each) and 2 small pieces (about 3 ounces each). Tint 1 large piece of dough red and the other orange, kneading the food coloring into the dough with gloved hands or a rubber spatula. Tint 1 medium piece of dough yellow and the other green. Tint 1 small piece of dough blue and the other purple.
Using gloved hands, roll the purple dough into a 7-inch log (about 3/4-inch-thick) on a floured sheet of parchment paper; set aside. Using a rolling pin, roll out the remaining pieces of dough into rectangles on separate floured sheets of parchment paper, dusting with more flour as needed: 3 1/2 by 7 inches for blue; 5 by 7 1/2 inches for green; 6 by 8 inches for yellow; 7 by 8 1/2 inches for orange; 8 by 9 inches for red.
Tightly wrap the blue dough around the purple log, keeping the dough in a log shape; pinch the seam to close. Continue wrapping the log with the dough: green, then yellow, orange and red. Wrap the whole log in plastic wrap; freeze until very firm, about 1 hour.
Preheat the oven to 375 degrees F. Trim the ends of the dough log, then slice into 3/8-inch-thick rounds. Slice each round in half. Arrange about 1 inch apart on 2 unlined baking sheets and refrigerate until ready to bake, at least 15 minutes.
Bake, one pan at a time, until the cookies are just set around the edges and golden on the bottom, 10 to 15 minutes. Let cool 5 minutes on the pan, then transfer to racks to cool completely.
Meanwhile, put the candy melts in a medium microwave-safe bowl and microwave in 30-second intervals, stirring, until smooth, about 2 minutes. Transfer to a resealable plastic bag and snip a corner. Pipe small clouds on the ends of each rainbow. Let set, at least 5 minutes.