Function flip

Flips a percentage-scale number: 1 - v.

The utility of this function is that it sanity-checks that v is in 0..1 scale.

flip(1);   // 0
flip(0.5); // 0.5
flip(0); // 1