Here's why:
* Gravity: The sun's attraction is due to gravity, which depends on the mass of the object. The color of an object has no impact on its mass.
* Electromagnetic Radiation: The sun emits electromagnetic radiation, including light. Black objects absorb more of this radiation, which can make them feel warmer. However, this warmth is due to absorbed energy, not increased gravitational attraction.
In short, the sun's attraction is based on mass, not color. A black object and a white object of the same mass will experience the same gravitational pull from the sun.