Hi I'm a beginning processing user and I've been stumped by this problem for a couple of days.
I've been trying to create a grid of squares that the user can select the color of each square within the grid. The problem that I'm having is that as soon as I release my mouse button the color of the square I was trying to change goes back to black.
I know that my problem is being caused by the fact that I'm using c (line 78) as the fill value for all of my squares. I think the solution is to create an array of c values, but arrays are still a bit of a mystery to me and I keep getting errors with the different methods I've tried.
Thank you in advance for your help
MyRect [] []grid;
int k, kc;
int c;
int r = color(255,0,0);
int g =color(0,255,0);
int b =color(0,0,255);
int cols = 17;
int rows = 10;
void setup() {
size (450,300);
grid = new MyRect [cols] [rows];
for (int i =0; i < cols; i++) {
for ( int j = 0; j< rows; j++) {
grid[i][j] = new MyRect (i*21+5,j*21+5,20,20,i,j);