xxxxxxxxxx
29
// REFERENCE PALETTE
let colors = ["#FF9B9B", "#FFD6A5", "#068FFF", "#9681EB"];
// DAY TO DAY DATA
let t = [36, 36, 37, 39,34,32,12,45,20,31,20,30,34,32];
// 0 : none / 1 : sticky / 2 : wet / 3 : lubricative
let texture = [0,1,2,0,1,2,3,2,2,1,1,2,3,0];
let lengthArray = t.length
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for(let i = 0 ; i < lengthArray ; i++){
// map the t[i] value that goes from 35 to 39 on a scale of height to 0
let y = map(t[i],11,46,height,0)
let x = map(i, 0,lengthArray,0,width)
fill(colors[texture[i]])
circle(x,y,20);
}
}