mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-05 20:49:15 +01:00
processing-js 0.4 has been merged in some relevant parts basic and topic scripts added for test color handling fixed, more scripts show up now
26 lines
434 B
Plaintext
26 lines
434 B
Plaintext
void setup()
|
|
{
|
|
size(200, 200);
|
|
background(51);
|
|
noStroke();
|
|
smooth();
|
|
noLoop();
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
draw_target(68, 34, 200, 10);
|
|
draw_target(152, 16, 100, 3);
|
|
draw_target(100, 144, 80, 5);
|
|
}
|
|
|
|
void draw_target(int xloc, int yloc, int size, int num)
|
|
{
|
|
float grayvalues = 255/num;
|
|
float steps = size/num;
|
|
for(int i=0; i<num; i++) {
|
|
fill(i*grayvalues);
|
|
ellipse(xloc, yloc, size-i*steps, size-i*steps);
|
|
}
|
|
}
|