Start by brushing a 1.5-2L rectangle or square baking pan, or 3 llaneras, with butter or oil. Set it aside.
In a large bowl, sift together the rice flour, glutinous rice flour, sugar, and salt.
Take ½ cup of the coconut milk and set it aside. Pour the remaining coconut milk into the dry ingredients. Mix until well blended.
Transfer the mixture to a pan and turn the heat to medium. Stir regularly until it becomes a thick, sticky paste. Add the vanilla extract and then turn off the heat.
Take about ½ of the mixture and transfer it to a separate bowl. Add the ube halaya to the bowl and mix it in. Add a few drops of ube flavor if desired.
Transfer this ube mixture to the prepared baking dish or divide it equally among the llaneras. If the mixture is too sticky, grease a spatula with oil and use it to spread and even out the mixture.
Spread the remaining white paste on top, making sure to spread it evenly.
In a separate bowl, mix 1 tablespoon sugar and 1 teaspoon rice flour with the reserved ½ cup coconut milk. Heat it in the microwave or on the stovetop just until warm enough to dissolve the sugar.
Pour this mixture on top of the cooked mixture.
Place the baking dish or llaneras on the highest rack of the oven and bake at 200ºC/400ºF until the top becomes bubbly and brown spots form.
Remove from the oven and let it cool down a bit before serving.