xxxxxxxxxx
46
let SweetandSour;
let gridSize = 60;
let t = 'SWEET NOT SOUR';
function preload() {
SweetandSour = loadImage("sauce.png");
}
function setup() {
createCanvas(windowWidth, windowHeight);
rectMode(CENTER);
}
function draw() {
background(0);
noStroke();
for (let i = 0; i < gridSize; i++) {
for (let j = 0; j < gridSize; j++) {
let thisColor = SweetandSour.get(
i * SweetandSour.width/gridSize,
j * SweetandSour.height/gridSize
);
fill(255);
push();
noStroke();
translate(i * width/gridSize,
j * width/gridSize);
//rotate(frameCount*0.1 + map(thisColor[0], 0, 255, 0, PI))
textSize(20);
fill(thisColor);
text(t, width/gridSize ,height/gridSize);
pop();
}
}
}