When it comes to airplanes, white is the primarily preferred color because it reflects the sun’s rays and radiation. Thus, since it is painted white, the airplane does not heat up inside as much. Also, this reduces the cost of cooling the cabin. White paint acts as a sort of “sunscreen lotion,” according to an aviation expert. Moreover, this color is better preserved over time.
Another reason why this color is preferred is the need to protect the composite materials used in the construction of modern airplanes. For example, the front part of the airplane is made of thin transparent plastic because it shelters the radar. The control surfaces are also made of composite materials. They are painted in white or light gray to protect them from the sun, which can affect their properties over time.
However, this does not mean that planes painted in other colors are dangerous. But they require significantly higher maintenance costs: more energy is needed to cool the cabin, and the paint degrades more quickly in direct sunlight. There have been companies like American Airlines, who have not painted their airplanes for decades. However, from time to time, the aircraft had to be polished because the aluminum tends to become matte and the cost of such a procedure is definitely not small.
Also, they are painted white for security reasons. A white airplane is easier to be spotted in the sky.