int mix(int a, int b, int n, int d)
An integer which is a mix of a into b, based on the position of n in range [0,d].
This function calculates how much of a will be mixed into b, proportional to the position of n in the range from 0 to d. If n is 0, the value of b is returned, if n is equal to d, the value of a is returned. For any values of n in between 0 and d, a proportional value is calculated.
This version of the mix function maintains compatibility with the algorithm used by Filter Factory plugins.
%ffp ctl(0): "Darken", range = (0, 100) R = mix(0, r, ctl(0), 100) G = mix(0, g, ctl(0), 100) B = mix(0, b, ctl(0), 100)