Chop the greens. Trim most of the stem off the chard and chop the leaves and stems. The greens are the star of the dish, but the stems add a burst of color.
Blanch the greens. In a large pot of boiling water, blanch rainbow chard in batches, cooking until wilted - about 1 minute. Transfer to an ice bath immediately. Continue until all the rainbow chard is blanched. Following the ice bath, squeeze the chard thoroughly in a kitchen towel.
Sauté the vegetables. In a deep-sided saute pan, heat the olive oil on medium-low heat, add the shallots and season with about ¼ teaspoon salt. Cook while occasionally stirring with a wooden spoon or spatula so the shallots do not burn, about 2 minutes. Add in the garlic, cook 1 more minute. Remove from heat, stir in the rainbow chard and then transfer the vegetables to a side dish while you prepare the sauce. Butter a 9x13 inch baking dish and preheat the oven to 425F.
Make the sauce. In a large saucepan, melt the butter over medium heat, then stir in the flour to form the roux. The texture will be like a thick paste. Gradually pour in ⅓ of the milk, whisking constantly to remove any clumps while the mixture thickens. Repeat a second and third time until all the milk is incorporated and the sauce is smooth. Continue whisking until sauce begins to boil. Reduce heat to low and cook about 15 minutes, occasionally stirring. The sauce should be thick and creamy, any flour taste should cook-off at this point.
Make the gratin. Whisk in the parmesan cheese, ½ cup gruyere cheese, and nutmeg. Combine the sauce with the chard and shallots, season with salt and pepper to taste. Transfer the rainbow chard and shallot mixture to the baking dish. Sprinkle with the remaining gruyere cheese.
Bake. Bake in the upper third of the oven for about 25 to 30 minutes, until bubbling and the top is golden brown. Let the dish rest about 8 to 10 minutes before serving to allow the creamy sauce to set.