Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Clamp value into [min, max]. When isCyclic is true, an underflow (value below min) wraps to max and an overflow wraps to min. When it is false, the value is clamped to the nearest endpoint.

      The wrap is one-step: this function does not handle multi-period overshoot (e.g. value = max + 5 → max + 5 - period). Callers that need full modular wrap should compose this with a normalization pass.

      Parameters

      • value: number

        The candidate value (typically current ± step).

      • min: number

        Inclusive lower bound.

      • max: number

        Inclusive upper bound.

      • isCyclic: boolean

        When true, out-of-range values wrap to the other end.

      Returns number

      A value in [min, max].