let amountOfPoints = thisComp.layer("CONTROLS").effect("amount of points")("Slider");
let distanceBetweenLines = thisComp.layer("CONTROLS").effect("distance between lines")("Slider");
let distanceBetweenPoints = thisComp.width/amountOfPoints;
let yInfluence = thisComp.layer("CONTROLS").effect("Y influence")("Slider");
let myPoints = [];
for(i=0; i<=amountOfPoints; i++) {
let tempPoint = fromComp([i*distanceBetweenPoints, (index-1)*distanceBetweenLines]);
let sample = thisComp.layer("ANIMATION").sampleImage(toComp(tempPoint), [1, 1]);
let sampleHSL = rgbToHsl(sample);
let posInfluence = linear(sampleHSL[2], 0, 1, yInfluence, -yInfluence);
let newPoint = tempPoint + [0, posInfluence]
myPoints.push(newPoint);
}
createPath(points = myPoints, inTangents = [], outTangents = [], is_closed = false);
/*
Expression by Francisco Giordano, November 2020.
Free for personal use and commercial use.
Instagram @ae.fran.giodano - frangiordano96@gmail.com
*/