Why does soap and lime juice solution turn red with turmeric?

Turmeric contains a chemical compound called curcumin, which is a natural indicator. Curcumin changes colour in the presence of acids or alkalis. In a soap and lime juice solution, the lime juice is acidic, so it causes the curcumin to turn red.

The chemical reaction that takes place is:

Curcumin + H+ (from lime juice) → Red-coloured compound

This reaction is reversible, so if you add an alkali to the solution, the curcumin will turn yellow again.