Cut the pandan leaves into ½-inch wide pieces. (I find that a pair of scissors does the job best.) Blend the pandan leaves together with 3-4 tablespoons of water in a blender until fine, then strain the liquid and discard the pulp. Place this in a pot, with the rest of the water, sugar, and agar-agar powder. Give it a quick stir and bring this to a boil, then set aside, covered.
Brown layer
Place the gula melaka, water and agar-agar powder in a pot, and bring to a boil. Simmer until the gula melaka completely dissolves, then set it aside, covered.
White layer
Pour the coconut milk, water, sugar, salt, and agar-agar powder in a pot, and bring to a quick boil. Remove from the heat and set aside, covered.
Starting with the white layer, measure out 250ml of the coconut milk syrup, and pour this through a fine sieve into a 20 x 20cm tray. Leave it for 5-10 minutes to set, or until it is firm to touch. Give your measuring jug and sieve a quick wash, then repeat the process for the brown layer, and then the green layer. Do this until you run out of syrup; you should end up with 3 layers of each colour in total.