I've done my research to solve this problem but without any success.
I want my rectangle to switch its fill randomly black or white, but all I
can see is a black rectangle.
Who has a suggestion?
float x;
float y;
color white =color(255);
color black =color(0);
color[] colors = { //random selects one of above colors
I want to make a very easy sound programm but as a newbie there's nothing easy in its beginnings ;)
Idea_ The higher the mouse the higher the frequency. I tried following but I got this error message:
"the local variable freq may not have bee initialised".
relating to an older post I've got an new question.
How to express following with code language:
The first black pixel of an column will be saved
and after that the programm should go on scanning
the next column, saving a pixel position again and
so on and so in.
Thanks for any help.
*edit*
Would dist() probably help? My idea is that it
calculates the distance between the very first pixel
and the first black pixel. But I also don't know what's
this in code language.
for (int x = 0; x < source.width; x++) {
for (int y = 0; y < source.height; y++ ) {
int loc = x + y*source.width;
int black = 0;
int white = 255;
if (brightness (destination.pixels[loc]) == black) {
}
// save the position of the first black pixel in this column