Preheat the oven to 350°F (175°C) and line a standard 12-cup muffin pan with cupcake liners.
Whisk together the flour, cocoa powder, baking soda, and salt.
In a separate large bowl, beat the softened butter and granulated sugar for 2–3 minutes until light and fluffy.
Add the eggs one at a time, mixing after each addition.
Mix in the vanilla extract and enough purple gel food coloring to achieve a rich purple shade.
Add the dry ingredients in portions, alternating with the buttermilk, mixing only until combined.
Stir in the white vinegar.
Divide the batter between the cupcake liners, filling each approximately two-thirds full.
Bake for 18–21 minutes, until a toothpick inserted into the center comes out clean or with a few moist crumbs.
Cool in the pan for 5 minutes, then transfer to a wire rack and cool completely.
For the frosting, gently warm the heavy cream without boiling it.
Add the culinary lavender and steep for 10–15 minutes.
Strain the cream and allow it to cool completely.
Beat the softened butter for 2–3 minutes until creamy.
Gradually beat in the powdered sugar.
Add the cooled lavender-infused cream gradually, followed by the vanilla and a small pinch of salt.
Beat until light, smooth, and pipeable.
Pipe the lavender frosting over the completely cooled cupcakes.
Garnish very lightly with culinary lavender if desired.