Below are codes through which I was trying to achieve the hue property on a grid of circles.
var circles = [];
for(var i=20 ; i<=1500 ; i+=100){
for(var j=40 ; j<=600 ; j+=110){
var newCircle = new Path.Circle(new Point(i, j), 20);
newCircle.fillColor = 'red';
circles.push(newCircle);
}
}
function onFrame(event){
for(var i=0 ; i<circles.length ; i++ ){
circles[i].fillColor.hue += 1;
}
}
This is the code. Now I am trying to give different colors to each circle using the random color func I created in a seperate JS file but the variables like "num" aren't accessible in that js file.I am not able to link them.
This is the link to codepen : https://codepen.io/akashyap/pen/qMgpGQ
I am not able to figure out the " Using paperscript directly with javascript" section of :
http://paperjs.org/tutorials/getting-started/using-javascript-directly/