Skip to content

Day Phase System

DayPhaseSystem gives solar-day intervals useful names and palettes, such as dawn, daylight, or night. Use it when behavior should follow the changing daylight schedule rather than a fixed civil-clock hour.

Configure a profile

  1. Enable the context's Astronomy and its Time/Calendar prerequisites.
  2. Create Assets > Create > Sital > Tunal > Day Phase Profile, or duplicate a supplied profile.
  3. Assign the profile to Day Phase System.
  4. Configure enabled phases in cyclic temporal order. Include Sunrise and Sunset transitions for an ordinary day.
  5. Inspect resolved ranges at short and long day lengths before configuring reactive phase selections or presentation palettes.

Each shared transition ends one phase and begins the next. Preferred positions combine the adjacent phase end/start anchors and offsets, interpreted as fractions of a solar day. Sunrise and sunset are fixed partition boundaries. Offsets inside the daylight and darkness arcs are fitted to those arcs in phase order; a phase can collapse if there is no room. Do not author arbitrary overlapping ranges expecting independent priority rules.

The last and first enabled phases meet across midnight. An apparent wrap in the Inspector is part of a circular schedule, not necessarily a reversed interval.

Polar and unusual days

Profiles have optional Polar Day and Polar Night phases. Sunrise/sunset may be unavailable at high latitude; read the system's polar/fallback state rather than inventing a clock time for a missing event.

Enable Polar Influence affects presentation palettes as daily minimum/maximum solar elevation approaches a polar boundary. Approach Range (degrees) defaults to 4, constrained to 0.1–15°. This gradually blends visual influence; it does not change exact phase classification or turn a nearly polar day into a true polar day. A reactive “selected phase” condition and a blended sky palette can therefore intentionally respond differently.

State and events

CurrentPhase can be unavailable; use HasCurrentPhase before consuming it. CurrentPhaseProgress, resolved start/end positions, CurrentPhaseIsFallback, and resolved phase ranges support UI and debugging. onPhaseChanged supplies the current Phase; onPhaseUpdated indicates evaluated state updates without requiring a categorical phase change.

SetDayPhaseProfile(profile) changes the system's configuration. Recheck response phase selections when profile names/available phases change: a condition referencing a removed phase should not be assumed to activate. Use the profile Inspector's schedule/validation information before adjusting response smoothing to hide a schedule error.

Related: Astronomy, Reactive conditions, Sky.