Toast the nuts (if using) in medium heat. Here we dry roast it, but you can use some ghee if you like. Set aside.
In the same pan, add the ghee and heat it until hot. You know it's ready when adding a pinch of flour causes it to fry immediately.
Lower the heat and then add the sifted all purpose flour to it
and keep roasting it for few minutes until the aroma hits.
The texture will be thick, will be smooth and yet will clump together without sticking too much to the bottom. The heat should be low, to make sure it doesnt change color or get burnt. Set aside.
In another pan, add the water and sugar together
and let it come to a boil.
You want to cook it until an one-string consistency is reached wherein a thin long string is formed up to 1- 2 inches when tested in between thumb and fore finger. The temperature should be around 220-230F.
At this stage add coloring if desired. Lower the heat and add the flour mixture to it.
Mix it until well combined. If you live in a warm region, then you can switch off the flame and keep mixing until the mixture thickens. But in cooler/colder places, I find cooking it further in the stove (in low heat) helps to thicken it fast .
You know its ready when the mixture isn't very easy to stir like before and has a slightly pourable yet thick consistency. You can further check the readiness by dropping a bit on the counter top. Let it sit for few seconds to find that it sets instead of being malleable like a halwa. Once ready, pour this to a greased pan of your choice.
Spread uniformly and add the nuts on top. Press it slightly and let it sit for few minutes.
When almost set, make cuts of any shape of your choice and let it further cool down completely.