xxxxxxxxxx
33
//This code was in part done while learning about Perlin noise by the Coding Train on youtube and following his tutorials//
let xOff = 0; //offset on X axis//
let yOff = 10000; // offset on Y axis//
let offset = 0; //offset for color//
function setup() {
createCanvas(400, 400);
background(0);
}
function draw() {
// used the mapping function in order for the perlin noise to scale around with the canvas //
let x = map(noise(xOff), 0, 1, 0, 400);
let y = map(noise(yOff), 0, 1, 0, 400);
n = noise(offset); // declared the offset in for the colors//
// found out about HSB coloring with perlin noise by this sketch https://editor.p5js.org/amcc/sketches/XcXWNTPB-//
colorMode(RGB);
// I wanted to make the srokes also change colors, maybe it could be done with the same result with noStroke//
stroke(255,255,255);
//Making the offsets change a bit in order for the circle to move around the screen//
xOff += 0.01;
yOff += 0.01;
colorMode(HSB);
//filling in with perlin noise in order to have different but somewhat matching colors//
fill(n * 255, 180, 180);
ellipse(x, y, 50);
offset += 1;
}