mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-05 12:39: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
24 lines
431 B
Plaintext
24 lines
431 B
Plaintext
int barWidth = 5;
|
|
int[] brightness;
|
|
|
|
void setup()
|
|
{
|
|
size(200, 200);
|
|
colorMode(HSB, 360, height, height);
|
|
brightness = new int[width/barWidth];
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
int j = 0;
|
|
for (int i = 0; i <= (width-barWidth); i += barWidth) {
|
|
noStroke();
|
|
if ((mouseX > i) && (mouseX < i+barWidth)) {
|
|
brightness[j] = mouseY;
|
|
}
|
|
fill(i, height, brightness[j]);
|
|
rect(i, 0, barWidth, height);
|
|
j++;
|
|
}
|
|
}
|