Preheat the oven to 180C, 350F, gas 4.
Put 100g (3¾oz) pistachios into a coffee grinder and blitz them to a powder. If you don’t have a coffee grinder, you can use a food processor; it just won’t grind them as finely.
Trim the courgettes’ ends and grate them finely.
Beat the eggs and sugar in an electric mixer until pale, light and creamy. (If you don’t have one, a wooden spoon and mixing bowl are fine.) Fold in the courgettes, ground pistachios, flour, lemon zest, baking powder and bicarbonate of soda. Combine everything, scooping up the mixture from the bottom of the bowl, but be careful not to over-mix.
Put into a 20cm (8in) cake tin that you’ve buttered and base-lined with greaseproof paper. Bake for 45-50 minutes. The cake is cooked when a skewer inserted into the centre comes out clean.
Leave to cool in the tin for 10 minutes then turn the cake out onto a wire rack, carefully peel off the paper and turn the cake the right way up. Leave to cool completely.
To make the icing, simply mix the icing sugar with the lemon juice until it’s smooth. Add the colouring paste if you are using it – you need just a little on the tip of a knife. I like to put the icing mixture in the fridge for a short while to let it firm up, before spreading it over the cake with a small palette knife. Leave to set a little, then sprinkle with the chopped pistachios.