I'm quite new to coding and using Processing, but I've currently came up with this. It draws a shape when I press the buttons which I binded it to, but when I click the palette to change the colour, it also draws under the palette. Is there a way to prevent this?
Also when I try to increase or decrease the size by pressing UP or DOWN, the drawing tool just stops and I have to press it again for it to work. How can I get it to keep the drawing tool when I press it?
int row = 1;
int col = 10;
int shapeSize = 150;
color mouseCol = color(0);
Box[][] palette = new Box[col][row];
color[] boxCol = new color[10];
float targetX, targetY;
float penX, penY, ppenX, ppenY;
void setup(){
size(500,500);
background(255);
noStroke();
smooth();
for (int i=0; i<col; i++) {
for (int j=0; j<row; j++) {
palette[i][j] = new Box(3+i*25,3+j*20,20,20,2*j +i);