RPE Chart Utils
    Preparing search index...

    Function calculateValue

    • Interpolate between two values (number, number[], or string) by progress.

      Handles all RPE value types:

      • Numbers: standard linear interpolation.
      • number arrays (e.g. RGB color): per-component interpolation.
      • Strings with %P% markers: interpolates the embedded number.
      • Text reveal strings: reveals/hides characters progressively when one string is a prefix of the other.
      • Other strings: returns start until progress >= 1, then end.

      Parameters

      • start: string | number | number[]

        Start value.

      • end: string | number | number[]

        End value.

      • progress: number

        Progress ∈ [0, 1].

      Returns string | number | number[] | undefined

      Interpolated value; type matches the input types.

      calculateValue(0, 255, 0.5);              // 127.5
      calculateValue([255, 0, 0], [0, 0, 255], 0.5); // [127.5, 0, 127.5]
      calculateValue('%P%0', '%P%100', 0.3); // '30'
      calculateValue('Hello', 'Hello World', 0.5); // 'Hello Wor'