Files
FreeJ/scripts/processing/basic/hue.pde
Jaromil ae7b1ad056 progresses on processing script
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
2010-02-12 18:36:54 +01:00

24 lines
408 B
Plaintext

int barWidth = 5;
int[] hue;
void setup()
{
size(400, 400);
colorMode(HSB, 360, height, height);
hue = new int[width/barWidth];
noStroke();
}
void draw()
{
int j = 0;
for (int i=0; i<=(width-barWidth); i+=barWidth) {
if ((mouseX > i) && (mouseX < i+barWidth)) {
hue[j] = mouseY;
}
fill(hue[j], height/1.2, height/1.2);
rect(i, 0, barWidth, height);
j++;
}
}