Sunlight contains all of the colors of our visible spectrum; these colors combined together appear white. Red light has the longest wavelength and, therefore, the least amount of energy in the visible spectrum. Wavelength decreases and energy increases as you move from red to violet light across the spectrum in the following order: red, orange, yellow, green, blue, and violet.
As light wavelength decreases from red to blue light, so does the ability of light to penetrate water. Blue light penetrates best, green light is second, yellow light is third, followed by orange light and red light. Red light is quickly filtered from water as depth increases and red light effectively never reaches the deep ocean.
Color is due to the reflection of different wavelengths of visible light. When white light (containing all colors on the spectrum) strikes an object, some wavelengths are absorbed; wavelengths that are not absorbed reflect back to our eyes. That is what we perceive as the color of that object and it has an impact on the coloration patterns of animals in the ocean. When struck by white light, a red fish at the surface reflects red light and absorbs all other colors and thus appears red. However, the deeper you and the fish go, the less red the fish will appear, because there is less and less red light to reflect off of the fish. At 100 meters, red light does not penetrate and, at this depth, a red fish is difficult, if not impossible to see. Instead, the fish appears blackish because there is no red light to reflect at that depth, and the fish absorbs all other wavelengths of color.
In the twilight zone, there are numerous animals that are black or red. At depth, these animals are not visible. The black animals absorb all colors of light available and the red animals appear black as well since there is no red light to reflect and their bodies absorb all other available wavelengths of light. Thus, in the deep ocean, red and black animals predominate.
Since the color blue penetrates best in water, there simply are not that many blue animals in the midwater regions of the ocean – their entire bodies would reflect the blue light and they would be highly visible to predators.