I have many questions:
I have made this function invert, since random values tend to normalize in the middle so it's not very interesting as most of them turn out grey.
So what invert does is it'll try to polarize the values, by pushing it to the edge closer to 0 or 255.
But it won't compile, I kept getting
"unexpected token: float" on this line:
float invert (float in)
what's wrong?
full codes below, i know it's a silly silly bug...
======================
float invert (float in)
{
if (in >= 128)
{
return 256 - (in - 128);
}
else
{
return in - 128;
}
}
size(500,500);
for(int i=0; i<width*3; i++)
{
float r = random(width);
float s = random(width);
float t = random(width);
float v = random(width);
float rrr = random(255);
float ggg = random(255);
float bbb = random(255);
fill(invert(rrr), invert(ggg), invert(bbb), 10);
noStroke();
rect(r,s,t,v);
}
==========================
Another question: my setup() never work as well...
Now whenever I want to set a screen size i HAVE to do
size(500,500);
just by itself, and if I try to enclose it into setup() { //here }
the screen size will still change to 500,500, but nothing after setup() function can be executed
HELP