code to make this image:
void setup() {
size(400, 400); // sets size to 400 x 400 pixels background(0); // sets background color to black } void draw(){
stroke(0); // sets stroke color to black fill(225, 225, 0); // sets fill color to bright yellow ellipse(width/2, height/2, 400, 400); // draws ellipse centered with diameter 400 fill(225, 0, 0); // sets fill color to bright red rect(25, 25, 350, 350); // draws rectangle from corner (25, 25) with width/height of 350 fill(180, 180, 0); // sets fill color to a darker yellow ellipse(width/2, height/2, 350, 350); // draws ellipse centered with diameter 350 fill(168.75, 0, 0); // sets fill color to a darker red rect(50, 50, 300, 300); // draws rectangle from corner (50, 50) with width/height of 300 fill(135, 135, 0); // sets fill color to a medium yellow ellipse(width/2, height/2, 300, 300); // draws ellipse centered with diameter 300 fill(112.5, 0, 0); // sets fill color to a medium red rect(75, 75, 250, 250); // draws rectangle from corner (75, 75) with width/height of 250 fill(90, 90, 0); // sets fill color to dark yellow ellipse(width/2, height/2, 250, 250); // draws ellipse centered with diameter 250 fill(56.25, 0, 0); // sets fill color to dark red rect(100, 100, 200, 200); // draws rectangle with corner at (100, 100) and width/height of 200 fill(45, 45, 0); // sets fill color to very dark yellow ellipse(width/2, height/2, 200, 200); // draws ellipse centered with diameter 200 fill(0); // sets fill color to black rect(125, 125, 150, 150); // draws rectangle with corner at (125, 125) and width/height of 150 stroke(0, 225, 0); // sets stroke color to bright green line(200, 125, 125, 200); // draws line from (200, 125) to (125, 200) line(200, 125, 275, 200); // draws line from (200, 125) to (275, 200) line(125, 200, 200, 275); // draws line from (125, 200) to (200, 175) line(275, 200, 200, 275); // draws line from (275, 200) to (200, 275) fill(0, 0, 0, 0); // sets fill to transparent black rect(145, 145, 110, 110); // draws rectangle with corner at (145, 145) and width/height 110 stroke(0); // sets stroke color to black fill(0, 0, 25); // sets fill color to a very dark blue ellipse(width/2, height/2, 100, 100); // draws ellipse with center at middle and diameter of 100 fill(0, 0, 75); // sets fill color to dark blue ellipse(width/2, height/2, 80, 80); // draws ellipse centered with diameter 80 fill(0, 0, 125); // sets fill color to blue ellipse(width/2, height/2, 60, 60); // draws ellipse centered with diameter 60 fill(0, 0, 175); // sets fill color to bright blue ellipse(width/2, height/2, 40, 40); // draws ellipse centered with diameter 40 fill(0, 0, 225); // sets fill color to a very bright blue ellipse(width/2, height/2, 20, 20); // draws ellipse centered with diameter 20 stroke(0, 0, 125); // sets stroke color to bright blue line(25, 25, 375, 375); // draws line from (0, 0) to (400, 400) line(375, 25, 25, 375); // draws line from (400, 0) to (0, 400) line(200, 0, 200, 400); // draws line from (200, 0) to (200, 400) line(0, 200, 400, 200); // draws line from (0, 200) to (400, 200) } Problems:
void mousePressed() {
stroke(0); line(width/2, height/2, mouseX, mouseY); } |