Context: Observations at 0.1 have revealed the existence of dark cores in the bright filaments of sunspot penumbrae. Expectations are high that such dark-cored filaments are the basic building blocks of the penumbra, but their nature remains unknown. Aims: We investigate the origin of dark cores in penumbral filaments and the surplus brightness of the penumbra. To that end we use an uncombed penumbral model. Methods: The 2D stationary heat transfer equation is solved in a stratified atmosphere consisting of nearly horizontal magnetic flux tubes embedded in a stronger and more vertical field. The tubes carry an Evershed flow of hot plasma. Results: This model produces bright filaments with dark cores as a consequence of the higher density of the plasma inside the tubes, which shifts the surface of optical depth unity toward higher (cooler) layers. Our calculations suggest that the surplus brightness of the penumbra is a natural consequence of the Evershed flow, and that magnetic flux tubes about 250 km in diameter can explain the morphology of sunspot penumbrae.