Wash the rice thoroughly and soak it in water for 30 minutes. Boil the rice until almost fully cooked, then drain and set aside.
Melt the butter in a large pan over medium heat.
Stir in the whole spices and fry for 30 seconds until fragrant.
Add the pistachios, coconut and almonds, and fry for 1–2 minutes until lightly toasted.
Stir in the sugar and cook for 1–2 minutes, stirring continuously until the mixture develops a coarse, crumbly texture.
Pour in the milk and cook for 1–2 minutes, stirring until the sugar dissolves and forms a syrup.
Transfer the boiled rice to the pan and gently mix until evenly coated with the sugar syrup, taking care not to break the rice grains.
Add each food colour to a separate section of the rice without mixing them together.
Cover the pan and cook over low heat for 15 minutes, allowing the flavours and colours to infuse into the rice.
Turn off the heat and gently fluff the rice, allowing the different colours to blend slightly while retaining their individual appearance. Serve warm.