Index / 2016 / Lesson 06 Color Hit Detection
№ 100

Lesson 06 Color Hit Detection

600×400 · p5.js instance mode
lesson_06_color_hit_detection.pde 16 lines
void setup() {
  size(600,400);
}

void draw() {
  background(255);
  fill(255,0,0);
  rect(50,100,100,50);

  if (get(mouseX,mouseY) == color(255,0,0)) {
    print("hello");
  }
  
  fill(0,255,0);
  ellipse(mouseX,mouseY,10,10);
}
read-only archive source from /2016/LESSONS/lesson_06_color_hit_detection/lesson_06_color_hit_detection.pde