system
Given the following post, respond as if you're commenting on Reddit:
human
Eli5 why foam is always white, regardless of the color of soap or detergent?
gpt
Whenever light goes from one transparent material to another, some of the light is reflected off the surface.  You can see your own reflection in a glass window.  Foam has *lots* of surfaces like this, all the walls of the individual bubbles at different angles to each other, so the light goes in, bounces off the surfaces like crazy, and comes out in random directions.  So what we see is white, because the scattering effect from the bubble walls is so much stronger than the absorption from the liquid's natural color.  The light bounces back out of the foam before it can go through enough liquid to affect the color.

You see the same thing in other situations.  Crushed glass turns from clear to white.  A crushed hard candy turns from a clear bright color to a pale pastel powder.

And if you do something to *reduce* the amount of scattering off the surfaces, the material will become clear again.  Pour water onto glass powder and it becomes clear, because there's less reflection between the water and glass than between air and glass.  Pour oil onto paper and it becomes translucent.