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
29 lines
624 B
Plaintext
29 lines
624 B
Plaintext
color a, b, c, d, e;
|
|
|
|
void setup() {
|
|
size(200, 200);
|
|
noStroke();
|
|
a = color(165, 167, 20);
|
|
b = color(77, 86, 59);
|
|
c = color(42, 106, 105);
|
|
d = color(165, 89, 20);
|
|
e = color(146, 150, 127);
|
|
noLoop();
|
|
}
|
|
|
|
void draw() {
|
|
drawBand(a, b, c, d, e, 0, 4);
|
|
drawBand(c, a, d, b, e, height/2, 4);
|
|
}
|
|
|
|
void drawBand(color v, color w, color x, color y, color z, int ypos, int barWidth) {
|
|
int num = 5;
|
|
color[] colorOrder = { v, w, x, y, z };
|
|
for(int i = 0; i < width; i += barWidth*num) {
|
|
for(int j = 0; j < num; j++) {
|
|
fill(colorOrder[j]);
|
|
rect(i+j*barWidth, ypos, barWidth, height/2);
|
|
}
|
|
}
|
|
}
|