xxxxxxxxxx
//EXERCISE 4: Michelle Parlevliet
//This code is meant to evoke the same kind of complex sensation of fire crackling, or sparklers emitting sparks.
//This code uses lerpColour to create a randomized colour scheme involving blends of reds and oranges ((150,100,30) and (200,70,70))
function setup() {
createCanvas(400, 400);
background(0);
}
function mouseMoved() {
background(0,100);
var x = mouseX;
var y = mouseY;
var changing = color(150,100,30);//First, state the two colours you'll want to make up your imagined "colour spectrum".
var changed = color(200,70,70);//Do this^ by creating variables that are assigned your chosen colours.
var shifted = random(0,1);//Next, for this particular code I randomized the point along the spectrum (between 0 and 1) that the line will turn out to be.
var shifting = random(0,1);//Do this^ by assigning two variables a randomized value between 0 and 1, which will determine the strength of the colour in relation to one of your main colours.
var w = random(0,400);
var z = random(0,400);
var t = random(0,400);
var r = random(0,400);
var thickness = random(1,10);
var thicness = random(1,20);
let A = lerpColor(changing,changed,shifted);//Here we are defining the strokes using the variables we created regarding their colour.
let B = lerpColor(changed,changing,shifting);//I switched up the order of the two color variables I had (changed and changing) to create more diversity.
strokeCap(PROJECT);
strokeWeight(5);
stroke(A); //Finally, use your defined value in place of color values for your line.
line(x, y, w, z);
strokeWeight(2);
stroke(B); //As a result, you will see that the line continuously changes from orange to red to everything in between!
line(y,x,t,r);
}