please format code with </> button * homework policy * asking questions
hi, i have two sketches
let scale = 0.004;
function setup() {
createCanvas(1200, 1200);
smooth()
}
function draw() {
for(let x = 100; x < width; x++) {
for(let y = 100; y < height; y++) {
set(x, y, color(noise(scale*x,scale*y, frameCount*0.01)>0.4?255:0));
}
}
updatePixels();
}
that one should be at the bottom (cow pattern), and this one should go above (stripes):
// https://twitter.com/usefulslug/status/1265604318016811011
const palette = [];
const palette2 = [];
function setup() {
createCanvas(600, 600);
background(100);
colorMode(HSB, 255, 255, 255, 100);
const seed = random(255);
const variation = random(100);
const N = Math.floor(random(4, 8));
for(let i = -N; i <= N; i++) {
palette.push(color((seed + variation * i + 2550) % 255, random(255), random(255)));
palette2.push(color((seed + variation * i + 2550) % 255, 255, 255));
}
}
function draw() {
noStroke();
const w = width / palette.length;
for(let i = 0; i < palette.length; i++) {
for(let j = 0; j < 5; j++) {
fill(lerpColor(palette[i], palette2[i], j / 4));
rect(i * w, height / 5 * j, w, height/5);
}
}
noLoop();
}
i combined them this way:
[```] (cow2 - OpenProcessing)
this is example with the least errors i get.
i read errors, and correcting each one just gets me few more.
thank you so much if anyone can find what i am writting wrong!
mg