The ocean is a filter
The light spectrum makes us see things in certain colors, for example, every time it snows or when the sun sets. It's no different when you see the different shades of blue and other ocean colors when you go to the beach. First off, the water is blue because of the sky. The sky is blue (most of the time) and some of the sunlight reflects the color of sky and makes the ocean look blue or whatever color the sky looks like that day. Like, if it's not very nice outside and the sky is overcast, the water may look a grayish blue color, just like the sky. Also sunlight scatters, after penetrating the water, and the particles in the water catches it, changing the color of the water to look like the color of the particles in the water ("Why is the Ocean Blue?"). Depending on the particles in the water, it changes color to reflect those particles. This layer of the ocean is called the "photic zone" because that's where most of the sunlight is absorbed (Nye). After 3,300 feet, you can't see the light any longer (Macquitty).