There is currently only one natural source of light, which is Kerbol, the central star of the Kerbol System. It can power solar panels which generate electric charge. It is also possible to add artificial sources of light like electric lights to make parts of it visible while being in the shadow. All celestial bodies, except for Kerbol, throw a shadow behind them which is perceived as night when being on the surface.
Eclipses happen when a celestial body passes in front of Kerbol blocking it fully or partially. As of 0.21.1[outdated] it doesn't get dark if Kerbol is blocked by a body which isn't the source of the sphere of influence the craft is in. To determine how complete a body can eclipse Kerbol the distance and inclination from the viewed object and the eclipsing body relative to Kerbol are important. A body can fully eclipse Kerbol only if it is close enough to the observer to appear as large as Kerbol. This is expressed as angular or apparent size which is how much of the view port is occupied by the body. From Kerbin's surface the Mun has an apparent size of 1.91° and Kerbol has a size of about 2.2°, so the Mun can almost completely eclipse Kerbol. As both Kerbin and Mun don't have any inclination every time the Mun is in between Kerbin and Kerbol an eclipse occurs.
The synodic period determines the time a moon need to be at the same position relative to the planet and Kerbol. So in the case of Kerbin and Mun the time between two eclipses is the synodic period. If the orbit of the moon is inclined not every orbit an eclipse occurs, so that the time between two eclipses are a multiple of the synodic period.
Partially and full eclipses will hide the outshine effect shown on the left.[specify when it is partially] Until the effect disappears and the moon or planet is visible in front of Kerbol, solar panels won't generate electricity.
The intensity of the light varies depending on the distance. In the real-word it follows the inverse-square law, resulting in four times the intensity when halving the distance. But in Kerbal Space Program the intensity is following a spline curve of 3 piecewise cubics defined from 4 points:
|68,773,560,320||0.5×||Jool's semi-major axis|
|206,000,000,000||0×||Almost 3x Jool's orbit|