The phenomenon you're describing is known as "twilight." Twilight occurs when the Sun is below the horizon, either before sunrise or after sunset. During these times, the sky can take on various colors, including shades of orange.
The orange coloration of the sky during twilight is mainly due to the scattering of sunlight by the Earth's atmosphere. To understand this, we need to consider how light interacts with the atmosphere.
During the day, when the Sun is above the horizon, the Earth's atmosphere scatters sunlight in all directions. The atmosphere scatters shorter-wavelength light, such as blue and violet, more than longer-wavelength light, such as red and orange. As a result, we see the sky as blue during the day.
During twilight, when the Sun is below the horizon but still illuminating the atmosphere, the path length of sunlight through the atmosphere increases. This longer path length scatters more of the shorter-wavelength blue and violet light, leaving predominantly longer-wavelength light to reach our eyes. The result is a shift in the color of the sky towards warmer hues, such as orange and red.
Additionally, the presence of particles and pollutants in the atmosphere can further influence the color of the sky during twilight. Dust, pollution, and other aerosols can scatter and absorb sunlight, affecting the colors we perceive.
It's important to note that the precise colors and intensity of twilight can vary depending on atmospheric conditions, such as humidity, cloud cover, and the amount of particles present. This variability contributes to the beautiful and ever-changing hues we observe during different twilight periods.