Why does the inside of an automobile get warm after hours of sitting in direct sunlight?

The sun's heat gets trapped in the interior of a car. Also depending on what color the interior is, it may get hotter or cooler.