1To prepare cake: Preheat oven to 375 degrees F. Coat two 9-inch round cake pans with cooking spray.
2.Whisk all-purpose flour, whole-wheat flour, cocoa, baking powder and salt in a medium bowl.
3.Beat sugar and butter in a large bowl with an electric mixer on medium speed until crumbly, about 2 minutes. Beat in egg yolks one at a time, then vanilla and food coloring (if using) until smooth.
4.Beat in half the buttermilk on low speed until smooth, then half the flour mixture. Scrape down the sides of the bowl, then beat in the remaining buttermilk. Beat in the remaining flour mixture just until combined.
5.Clean and dry beaters. Beat egg whites in a clean medium bowl at high speed until soft peaks form. With a rubber spatula, gently fold the whites into the batter until just incorporated, using long, even strokes. Divide the batter between the prepared pans, spreading to the edges. Gently rap the pans against the counter once or twice to settle the batter.
6.Bake until a toothpick inserted into the center comes out clean, 15 to 20 minutes. Cool on a wire rack for 10 minutes, then invert the layers onto the rack, remove the pans and let cool to room temperature, about 45 minutes more.
7.To prepare frosting and assemble cake: Beat cream cheese, confectioners' sugar and vanilla in a large bowl with an electric mixer on medium speed until smooth. Place one cake layer top-side down on a serving plate; cover with half the frosting, spreading just to the edges. Set the second layer on top, top-side down. Spread the remaining frosting on the top only. Sprinkle with grated chocolate, if desired.