Skip to main content

compute_auto_frontlight_levels

Function compute_auto_frontlight_levels 

Source
pub fn compute_auto_frontlight_levels(
    now: DateTime<Local>,
    coordinates: Coordinates,
    night_brightness: LightLevel,
    current_intensity: LightLevel,
) -> LightLevels
Expand description

Computes the frontlight levels that should be active at the given time.

Brightness switches between current_intensity during daylight hours and night_brightness while the sun is down. Warmth ramps over a fixed transition window before sunrise and before sunset, reaching fully cool at sunrise and fully warm at sunset.