Closed dezi9dezi closed 2 years ago
PImage spain;
void setup() { size(900, 600); spain = loadImage("spain.png"); background(255); } void draw() { for (int i = 0; i<100; i++) { float x = random(width); float y = random(height); float loc = x+y*width; color col = spain.pixels[int(loc)]; fill(col); noStroke(); ellipse(x, y, 16, 16); } }
Hey Dezi! This repository manages the Coding Train website, it isn't the right place for questions. The best things you can do is join our discord.
Hope to see you there!
PImage spain;
void setup() { size(900, 600); spain = loadImage("spain.png"); background(255); } void draw() { for (int i = 0; i<100; i++) { float x = random(width); float y = random(height); float loc = x+y*width; color col = spain.pixels[int(loc)]; fill(col); noStroke(); ellipse(x, y, 16, 16); } }