Air molecules scatter light with an intensity that scales as 1/λ⁴ (Rayleigh's law), so 450 nm blue light scatters roughly five times more than 700 nm red light. Looking away from the sun, that scattered blue dominates — the sky is blue. Looking straight at a low sun, the direct beam has already lost most of its blue to scattering along a much longer path through the atmosphere (air mass ≈ 1/sin(elevation)), so what's left is reddened: Beer-Lambert extinction, T(λ) = exp(−τ₀(λ)·airmass), with τ₀ itself ∝ 1/λ⁴.
The 22° and 46° halos come from a completely different mechanism: hexagonal ice crystals in cirrus clouds act as tiny 60° and 90° prisms. A prism of apex angle A deflects light by a minimum deviation angle Dmin that depends only on the material's refractive index n:
D_min = 2 * asin( n * sin(A/2) ) - A
For ice (n ≈ 1.31) and A = 60° this gives Dmin ≈ 22°; for A = 90° it gives ≈ 46°. Because randomly tumbling crystals still cluster most rays near this minimum, a bright ring forms at exactly that angle around the sun. Ice is very slightly dispersive (n is a little higher for blue than red), so the simulator's n(λ) fit spreads the ring into a faint spectrum with red on the inner edge — the opposite edge order from a rainbow, because a halo is refraction-only with no internal reflection.