The initial layer of paint applied to the canvas or panel can be the underpainting. It is usually a thin layer of paint used to tone the canvas. Sometimes it is easier to cover the stark white canvas staring back at you when starting a new painting.
The underpainting can be used to lay out the basic composition of the painting. With such a thin layer of paint on the canvas it is easy to change or improve a composition early on. In the scene below I painted a thin wash of yellow over the whole canvas. When that dried I added another thin layer for the darks. This allowed me to see the position of the dune grasses, palm trees and the shadows.
The underpainting can be in any color. I like to use a complementary color when I have a bright sunlit scene like the one above. The indian yellow color is a complement to the violet shadows. A complementary color can enhance the color if some it is still seen when the painting is finished.
The underpainting can be done quickly as I did here in acrylic paint. This was dry in minutes and I could decide if I liked the composition immediately. From that point I started glazing white in the sky and sunlit areas on the sand dune. Then I applied the violet shadows on the sand dunes. As you can see, the thin layers of glazing left the indian yellow still showing through the paint. As the painting progresses you can decide whether to cover the underpainting entirely or let the underpainting be seen through the glazed layers.