(點圖可放大)
分享其中最長的一段code(可能是笨方法導致它太長)
size(450, 450);
background(0);
noStroke();
for(int i=0; i
fill(255-i/2,207-i*3/2,139-i);
rect(i,0,40,height/((i/40)+1));
}
for(int i=0; i
fill(255-i/2,207-i*3/2,139-i);
rect(400-i,0,40,height/((i/40)+1));
}
for(int i=0; i
fill(245-i/2,180-i*3/2,100-i);
rect(40+i,height/((i/40)+2),40,height/((i/40)+1.9));
}
for(int i=0; i
fill(245-i/2,180-i*3/2,100-i);
rect(360-i,height/((i/40)+2),40,height/((i/40)+1.9));
}
for(int i=0; i
fill(235-i/2,150-i*3/2,80-i);
rect(80+i,height*2/((i/40)+3),40,height/((i/40)+3));
}
for(int i=0; i
fill(235-i/2,150-i*3/2,80-i);
rect(320-i,height*2/((i/40)+3),40,height/((i/40)+3));
}
for(int i=0; i
fill(225-i/2,100-i*3/2,50-i);
rect(120+i,height*3/((i/40)+4),40,height/((i/40)+4));
}
for(int i=0; i
fill(225-i/2,100-i*3/2,50-i);
rect(280-i,height*3/((i/40)+4),40,height/((i/40)+4));
}
for(int i=0; i
fill(215-i/2,80-i*3/2,30-i);
rect(160+i,height*4/((i/40)+5),40,height/((i/40)+5));
}
for(int i=0; i
fill(215-i/2,80-i*3/2,30-i);
rect(240-i,height*4/((i/40)+5),40,height/((i/40)+5));
}
for(int i=0; i
fill(0);
rect(200+i,height*5/((i/40)+6),40,height/((i/40)+6));
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(255,255,255,j);
rect(200-i+j/2,height*5/((i/40)+6)+j/2,40-j,height/((i/40)+6)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(i+j/2,j/2,40-j,height/((i/40)+1)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(400-i+j/2,j/2,40-j,height/((i/40)+1)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(40+i+j/2,height/((i/40)+2)+j/2,40-j,height/((i/40)+2)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(360-i+j/2,height/((i/40)+2)+j/2,40-j,height/((i/40)+2)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(80+i+j/2,height*2/((i/40)+3)+j/2,40-j,height/((i/40)+3)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(320-i+j/2,height*2/((i/40)+3)+j/2,40-j,height/((i/40)+3)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(120+i+j/2,height*3/((i/40)+4)+j/2,40-j,height/((i/40)+4)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(280-i+j/2,height*3/((i/40)+4)+j/2,40-j,height/((i/40)+4)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(160+i+j/2,height*4/((i/40)+5)+j/2,40-j,height/((i/40)+5)-j);
}
}
for(int i=0; i
for(int j=0; j<40; j+=4) {
fill(0,0,0,j);
rect(240-i+j/2,height*4/((i/40)+5)+j/2,40-j,height/((i/40)+5)-j);
}
}
歡迎指教:D