level 1
就是在10秒之内让一个图形的颜色赤橙黄绿青蓝紫不断闪烁交替,真心求助!
2014年11月30日 11点11分
1
level 7
processing自带时间记录函数比如mills()你可以通过读取时间看时间变化,颜色你通过颜色抓取器看看赤橙黄绿青蓝紫的rgb颜色规律或者直接写也行
2014年12月01日 00点12分
2
能帮忙写一个不?初学者完全不懂。。
2014年12月01日 01点12分
level 6
你好,我帮你写了这段程序,可以每0.1秒换一次颜色,如果你想慢一点,可以改变totalTime的值。
希望这能解决你的问题。
int savedTime;
int totalTime = 100;
void setup() {
size(200,200);
background(0);
savedTime = millis();
}
void draw() {
// Calculate how much time has passed
int passedTime = millis() - savedTime;
// Has five seconds passed?
if (passedTime > totalTime) {
println( " 5 seconds have passed! " );
background(random(255),random(255),random(255)); // Color a new background
savedTime = millis(); // Save the current time to restart the timer!
}
}
2014年12月11日 03点12分
3
level 4
color colors[]={
#FFFFFF,#
F79E16,
#F7E516,#
2A6408,
#3BF716,#
1F4EF0,#C91FF0};
float a = 100;
float b = 100;
int flickFrames = 4;
void setup(){
size(400,400);
frameRate(20);
}
void draw(){
background(0);
fill( colors[ (frameCount/flickFrames)%colors.length ] );
ellipse(width/2,height/2,a,b);
}
2014年12月11日 03点12分
4