Saxonberg Server API
    Preparing search index...
    Index

    Constructors

    Properties

    colorTemperature: Quantity<"K"> | null
    intensity: Quantity<"lux">
    sources: readonly LightSourceRef[]
    ZERO: Light = ...

    The zero-light singleton.

    Methods

    • JSON serialization shape for tests / debugging.

      Returns {
          colorTemperature: { unit: "K"; value: number } | null;
          intensity: { unit: "lux"; value: number };
          sources: LightSourceRef[];
      }

    • Band shift arithmetic delegates to the generic Quantity.shiftTag machinery applied to the lux unit.

      Parameters

      • band: "pitch-black" | "very-dim" | "dim" | "lit" | "bright" | "blinding"
      • shift: number

      Returns "pitch-black" | "very-dim" | "dim" | "lit" | "bright" | "blinding"

    • Map a lux numeric value to a LightBand. Consults the live Quantity tag-table registry — the lux thresholds live in mud/config/quantity-tags.yaml and load at boot via QuantityApi.loadTagTables. A thin typed adapter over Quantity.tag() for the lux unit; reload of the YAML propagates here transparently.

      Throws if the lux table isn't registered (test setup gap) or if the registered tags don't match LightBand (content-side bug — the YAML tag list must equal the typed union by construction).

      Parameters

      • luxValue: number

      Returns "pitch-black" | "very-dim" | "dim" | "lit" | "bright" | "blinding"

    • Coerce a tag string, a Quantity<'K'>, or null into a Quantity<'K'> | null. Used by Light.of and the mixin setters. String input resolves through the registered KELVIN_TAGS table (in api/light.ts), so author-friendly tags like 'warm' and 'cool' round-trip to their canonical Kelvin values.

      Parameters

      • value: string | Quantity<"K"> | null | undefined

      Returns Quantity<"K"> | null

    • Band compare arithmetic delegates to the generic Quantity.compareTag machinery applied to the lux unit.

      Parameters

      • a: "pitch-black" | "very-dim" | "dim" | "lit" | "bright" | "blinding"
      • b: "pitch-black" | "very-dim" | "dim" | "lit" | "bright" | "blinding"

      Returns number