Code viewer for World: Mathias Bazin 2D Perlin no...

// Cloned by Mathias Bazin on 10 Apr 2019 from World "2D Perlin noise visualizer" by Mathias Bazin 
// Please leave this clone trail here.
 


function World() 
{ 
	
	this.newRun = function()
	{
		threeworld.init (  "white"  ); 
	};


}


//---- setup -------------------------------------------------------
// Do NOT make a setup function.
// This is done for you in the API. The API setup just creates a canvas.
// Anything else you want to run at the start should go into the following two functions.

let res = 75;
let time = 0;
let cols, rows;
let cc = 30;

function beforesetup()      // Optional 
{
	// Anything you want to run at the start BEFORE the canvas is created 
	
}


function aftersetup()       // Optional
{
	// Anything you want to run at the start AFTER the canvas is created 
	cols = width/res;
	rows = height/res;
	
}

function draw()             
{
    colorMode(HSB);

    for (let i =0; i<cols; i++)
    {
        for ( let j=0; j<rows; j++)
        {
            let color = noise(i/cc,j/cc,time)*255;
            stroke(color);
            fill(color, 200, 100);
            rect(i*res,j*res,res,res);
        }
    }
    
    time += 0.01;

    console.log(frameRate(),cc)
}