mixElement
An alias for the `mix` node that provides an alternative parameter order (`t, a, b`) for linear interpolation. It places the mix factor first to accommodate different coding styles.
Core Advantages
Provides flexibility in coding style. By placing the mix factor first, it can improve readability in complex node chains, acting as a zero-cost abstraction with no performance impact.
Common Uses
Application scenarios are identical to `mix`, only the syntax differs.
Blending colors with a mask: `mixElement(mask, colorA, colorB)`.
Creating animations with time: `mixElement(time, startState, endState)`.
How to adjust
Its effect is identical to `mix`. Adjusting the first parameter, `t`, controls the blend between the second parameter, `a` (when t=0), and the third parameter, `b` (when t=1). It only changes the position of the parameter you are adjusting in the code.
Code Examples
1// Blends between a and b using the mix factor t
2// Functionally identical to mix(a, b, t)
3const finalResult = mixElement( t, a, b );