Creates a list of interpolated values from a given list of ControlVars.
const v1 = new ControlVar(Units.num, 0)const v2 = new ControlVar(Units.num, 100)const interpolated = new InterpolatedVars("spacing", Units.px, [v1, v2])// interpolates from 0-100v1.set(50) // interpolated will now update to interpolate from 50-100 Copy
const v1 = new ControlVar(Units.num, 0)const v2 = new ControlVar(Units.num, 100)const interpolated = new InterpolatedVars("spacing", Units.px, [v1, v2])// interpolates from 0-100v1.set(50) // interpolated will now update to interpolate from 50-100
It can be passed multiple stops.
const interpolated = new InterpolatedVars("spacing", Units.px, [v1, v2, v3]) Copy
const interpolated = new InterpolatedVars("spacing", Units.px, [v1, v2, v3])
... or stops with positions (otherwise they are evenly spaced).
// positions should be in a 0-1 percentage rangeconst interpolated = new InterpolatedVars("spacing", Units.px, [[0, v1], [0.2, v2], [1, v3]]) Copy
// positions should be in a 0-1 percentage rangeconst interpolated = new InterpolatedVars("spacing", Units.px, [[0, v1], [0.2, v2], [1, v3]])
You can change interpolation control variables and any options using set:
set
interpolated.set("values", [vOther1, vOther2, vOther3])interpolated.set("options", {steps: 20}) Copy
interpolated.set("values", [vOther1, vOther2, vOther3])interpolated.set("options", {steps: 20})
Protected
Generated using TypeDoc
Creates a list of interpolated values from a given list of ControlVars.
It can be passed multiple stops.
... or stops with positions (otherwise they are evenly spaced).
You can change interpolation control variables and any options using
set
: