• Returns an expression that calculates the percentage of the given operand in the range [lowerBound, upperBound]. The expression evaluates to (operand - lowerBound) / (upperBound - lowerBound). For values of operand outside the range [lowerBound, upperBound], the results will lie outside the range [0, 1].

    Type Parameters

    • T extends string | number | Vector3

    Parameters

    • operand: Expression<T>

      The operand to evaluate. Should result in a number, point or color.

    • lowerBound: Expression<number | T>

      The lowerBound to evaluate. Should result in the same type as operand or a number.

    • upperBound: Expression<number | T>

      The upperBound to evaluate. Should result in the same type as operand or a number.

    Returns Expression<T>

    An expression that calculates the percentage of the given operand in the range [lowerBound, upperBound]. Results in a number, point or color depending on the type of the operands. When a number is used with an other type, the operation is applied to the individual element values and the result is of the other type.