function getcolor(mark) { let color0=color(97,44,142); let color1=color(22,116,188); let color2=color(1,163,150); let color3=color(129,196,64); let color4=color(245,181,47); let color5=color(237,91,52); let color6=color(234,35,94); let color7=color(186,34,129); let color8=color(97,44,142); switch(mark%8) { case 0:mcolor=color0;break; case 1:mcolor=color1;break; case 2:mcolor=color2;break; case 3:mcolor=color3;break; case 4:mcolor=color4;break; case 5:mcolor=color5;break; case 6:mcolor=color6;break; case 7:mcolor=color7;break; case 8:mcolor=color8;break; } }
case 0: getcolor(mark0) fill(mcolor); setsphere(i,j,t%400,mcolor); break; case 1: getcolor(mark0+1) fill(mcolor); setsphere(i,j,(t-40)%400,mcolor); break;
效果图