Returns an interpolator function between two boolean values.
Defaults to 0.5 as the threshold:
const i = interpolatorBoolean(false, true);i(0); // falsei(0.5); // truei(0.6); // true Copy
const i = interpolatorBoolean(false, true);i(0); // falsei(0.5); // truei(0.6); // true
You can also specify a different threshold:
const i = interpolatorBoolean(false, true, { threshold: 0.8 });i(0.7); // falsei(0.8); // truei(0.9); // true Copy
const i = interpolatorBoolean(false, true, { threshold: 0.8 });i(0.7); // falsei(0.8); // truei(0.9); // true
Optional
Interpolator function
Returns an interpolator function between two boolean values.
Defaults to 0.5 as the threshold:
You can also specify a different threshold: