In space the sun is white but the blue portion of the light separates from the ray when it passes through the atmosphere and makes the remaining colours appear yellow. The Blue portion of the sun light eventually becomes scattered and causes the sky to appear blue.
So the sun and tennis balls both originally appear white.
Sources
~2024 QI facts by John Lloyd
~BBC
~ NASA.gov website