Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- size(500, 500);
- background(255, 0, 0);
- }
- void draw() {
- background(255, 0, 0);
- fill(0, 0, 255);
- ellipse(250, 250, 50, 50);
- color myColor = get(mouseX, mouseY);
- if (red(myColor) == 255 && green(myColor) == 0 && blue(myColor) == 0) {
- println("it's red");
- } else if (red(myColor) == 0 && green(myColor) == 0 && blue(myColor) == 255) {
- println("it's blue");
- } else {
- println("it's something else");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement