# It won't select colors or stroke weight when I make the draw-program only draw in a specific area

**URL:** https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122
**Category:** Coding Questions
**Created:** [February 26, 2020, 3:01am UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122 "2020-02-26T03:01:53Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![WeeBoEtte](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)
#### Post date: [February 26, 2020, 3:01am UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/1 "2020-02-26T03:01:53Z")

</div>

I am trying to make a drawing program where it only draws in a rectangle made in setup. I want to still be able to use my color, size, and clearing ability that I made, but I can’t figure it out. Any tips would be great.

```auto
// Please note that I used heavy inspiration and help from this users own drawing program to create my own: https://www.openprocessing.org/sketch/26614/ by Basil Vendryes 

//The folowing program is a very simple drawing program. You can press you mouse key and you will be able to draw a line that follows the mouse
//you can also cange the color of the line, and clear the canvas instantly. You can also press any key on your keyboard and be able to draw an contiuous streem of circles. 

float x;
float y;

color red = color(255,0,0);
color green= color(0, 255, 0);
color blue= color(0, 0, 255);
color yellow= color(247, 240, 0);
color orange= color(247, 112, 0);
color violet= color(110, 0, 220);
color blueGreen= color(0, 247, 146);
color yellowGreen= color(157, 250, 0);
color pink= color(255, 28, 97);
color yellowOrange= color(255, 159, 3);
color white= color(255);
color black= color(0);
color rand = color(random(255));

float drawX;
float drawY;

float mainStroke= 1;

void setup(){
    
  
  size(2000,2000);
  smooth();
  background(255);
  
     fill(255);
    strokeWeight(4);
    rect(500,400,1000,1300);
    
}

void draw(){

colors();
  
  canvas();
  
  //I will make the options for different sizes to draw and the clearing option for the canavas as a rectangle 
   line(1550, 30, 1650, 30);
  strokeWeight(4);
  line(1550, 50, 1650, 50);
  strokeWeight(8);
  line(1550, 80, 1650, 80);
  strokeWeight(3);
  fill(255);
  rect(900, 10, 50, 50);
  
circleOpt(mouseX, mouseY);

  
}

  

void colors(){
  //The following code is used to make the boxes for my colors and the drawings stroke if clicked
    strokeWeight(1);
  fill(red);
  rect(10, 10, 50, 50 );
  strokeWeight(1);
  fill(orange);
  rect(60, 10, 50, 50 );
   strokeWeight(1);
  fill(yellowOrange);
  rect(10, 60, 50, 50 );
     strokeWeight(1);
  fill(yellow);
  rect(60, 60, 50, 50 );
     strokeWeight(1);
  fill(yellowGreen);
  rect(10, 110, 50, 50 );
     strokeWeight(1);
  fill(green);
  rect(60, 110, 50, 50 );
     strokeWeight(1);
  fill(blueGreen);
  rect(10, 160, 50, 50 );
  strokeWeight(1);
  fill(blue);
  rect(60, 160, 50, 50 );
     strokeWeight(1);
  fill(violet);
  rect(10, 210, 50, 50 );
       strokeWeight(1);
  fill(pink);
  rect(60, 210, 50, 50 );
       strokeWeight(1);
  fill(white);
  rect(10, 260, 50, 50 );
       strokeWeight(1);
  fill(black);
  rect(60, 260, 50, 50 );
    strokeWeight(1);
  fill(rand);
  rect(10, 310, 50, 50 );
  
}
//This is the function for my circle drawing tool, when any key is pressed, a circle will be drawn
void circleOpt(float x, float y) {
  if (keyPressed == true){
  ellipse(x,y,50,50);
  
  }
}
//This coding allows the drawing lines color to be altered when one of the sqaures of color is pressed
void colorPick(){
 if(mousePressed) {
    if(mouseX > 10 && mouseX < 60){
      if(mouseY >10 && mouseY < 60){
        stroke(red);
      }
      if(mouseY>60 && mouseY < 110){
        stroke(yellowOrange);
      }
      if(mouseY>110 && mouseY<160){
        stroke(yellowGreen);
      }
      if(mouseY>160 && mouseY<210){
        stroke(blueGreen);
      }
      if(mouseY>210 && mouseY<265){
        stroke(violet);
      }
      if(mouseY>265 && mouseY<315){
        stroke(white);
      }
      if(mouseY>315 && mouseY<365){
        stroke(rand);
      }
    }
    if(mouseX > 60 && mouseX < 110){
      if( mouseY > 10 && mouseY <60){
        stroke(orange);
      }
      if(mouseY > 60 && mouseY < 110){
        stroke(yellow);
      }
      if(mouseY > 110 && mouseY < 160){
        stroke(green);
      }
      if(mouseY >160 && mouseY < 210) {
        stroke(blue);
      }
      if(mouseY > 210 && mouseY <260){
        stroke(pink);
      }
      if(mouseY >260 && mouseY <310){
        stroke(black);
      }
    }
    if(mousePressed){
      if(mouseX > 1550 && mouseX <1650){
        if(mouseY >10 && mouseY <40){
          mainStroke= 1; }
        }
      if(mouseX > 1550 && mouseX <1650){
        if(mouseY >40 && mouseY <70){
          mainStroke= 4; }
      }
      if(mouseX > 1550 && mouseX <1650){
        if(mouseY > 70 && mouseY <100){
          mainStroke= 7;
      }  
    }
    strokeWeight(mainStroke);
    }
  if(mousePressed){
    if(mouseX > 900 && mouseX <950){
      if (mouseY > 10 && mouseY <60){
        background(255);
      }
    }
  }
  if(mousePressed){
  line(mouseX, mouseY, drawX, drawY);
  }
  }
  drawX=mouseX;
  drawY=mouseY;
  }         
  
 //The following function makes the colorPick(); fucntion draw within the rectangle made in setup
  void canvas(){
 
    if(mouseX>500 && mouseX<1500){
      if(mouseY>400 && mouseY<1700){
        colorPick();
      
            
          }

        }
      
    
  }

```

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [February 26, 2020, 2:38pm UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/2 "2020-02-26T14:38:08Z")

</div>

Hi there,

Welcome to the forum ! 🙂  
First of all please format your code using the `</>` button in the message editor.

I see one big problem in your code : **repetition** (you know that programmers hate repetition 😁)

You see that you have different color buttons that have the same behavior for each colors (when you click it, you change the color).

Instead of writing all the conditions for your buttons (because it’s too much pain and your code is not robust) we use a common concept used in Java and other languages : Object Oriented Programming ([https://en.wikipedia.org/wiki/Object-oriented\_programming](https://en.wikipedia.org/wiki/Object-oriented_programming)).

In this example, you can declare a `ColorButton` class :

```auto
class ColorButton{
  color c; //The button color
  int x; //x coordinate
  int y; //y coordinate
  int size;

  //The constructor
  ColorButton(color c, int x, int y, int size){
    this.c = c;
    this.x = x;
    this.y = y;
    this.size = size;
  }
}

```

Basically a class is representing an object and each object has its own properties (here it’s the color, and its position/size).  
An object can also have methods, it’s actions that performs modifications or get information on the object.

For example, in order to check if you clicked on the button, you can have the following method inside the class :

```auto
boolean isClicked(){
  return (mouseX > x) && (mouseX < x + size) &&
         (mouseY > y) && (mouseY < y + size);
}

```

So now every button is going to have the same function to check if it has been clicked.

Now in your main program, you can write this :

```auto
//If the user pressed the mouse
void mousePressed(){
  if(myButton.isClicked()){
    draw_color = myButton.c;
  }
}

```

You can follow this tutorial for more informations : [https://processing.org/tutorials/objects/](https://processing.org/tutorials/objects/)  
Don’t hesitate if you have more questions.

---

<div class="post-metadata">

### Author: ![WeeBoEtte](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)
#### Post date: [February 27, 2020, 12:45am UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/3 "2020-02-27T00:45:54Z")

</div>

Thank you so very much, you have no idea, how helpful this is for me!! I am still a little confused with the boolean because I keep getting an error in processing, but I am sure I will figure it out!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [February 27, 2020, 1:25pm UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/4 "2020-02-27T13:25:57Z")

</div>

I think [josephh](https://discourse.processing.org/u/josephh) posts really is the way to go.

* * *

**Remark**

A remark on your old code though:

colorPick() was called by canvas but inside the if-clause:

```auto
if(mouseX>500 && mouseX<1500){
  if(mouseY>400 && mouseY<1700){
    colorPick();
     }
    }

```

This **hindered** the mouse on reaching the color selector buttons.

You had this

```auto
//The following function makes the colorPick(); fucntion draw within the rectangle made in setup
void canvas(){

if(mouseX>500 && mouseX<1500){
  if(mouseY>400 && mouseY<1700){
    colorPick();
      }
    }
}

```

My version would be to treat canvas and buttons outside the canvas separately:

```auto

void mousePressed() {
  drawX=mouseX;
  drawY=mouseY;
}

//The following function makes the colorPick(); fucntion draw within the rectangle made in setup
void canvas() {
  if (mouseX>500 && mouseX<1500) {
    if (mouseY>400 && mouseY<1700) {
      if (mousePressed) {
        line(mouseX, mouseY, drawX, drawY); // ON CANVAS
        drawX=mouseX;
        drawY=mouseY;
      }
      return; // leave !!!!!!!
    }
  }
  // outside canvas : 
  colorPick(); // color selector and other buttons 
}//func 
//

```

Regards, Chrisir

* * *

**Entire Code**

```auto

// class-less version

// Please note that I used heavy inspiration and help from this users own drawing program to create my own: https://www.openprocessing.org/sketch/26614/ by Basil Vendryes

// The folowing program is a very simple drawing program. You can press you mouse key and you will be able to draw a line that follows the mouse.

// You can also change the color of the line, and clear the canvas instantly. 
// You can also press any key on your keyboard and be able to draw an contiuous stream of circles.

float x;
float y;

color red = color(255, 0, 0);
color green= color(0, 255, 0);
color blue= color(0, 0, 255);
color yellow= color(247, 240, 0);
color orange= color(247, 112, 0);
color violet= color(110, 0, 220);
color blueGreen= color(0, 247, 146);
color yellowGreen= color(157, 250, 0);
color pink= color(255, 28, 97);
color yellowOrange= color(255, 159, 3);
color white= color(255);
color black= color(0);
color rand = color(random(255));

float drawX;
float drawY;

float mainStroke= 1;

void setup() {

  size(2000, 2000);
  smooth();
  background(255);

  fill(255);
  strokeWeight(4);
  rect(500, 400, 1000, 1300);
}

void draw() {

  // stroke(0); 
  // strokeWeight(1);

  colors();

  canvas();

  //I will make the options for different sizes to draw and the clearing option for the canavas as a rectangle
  line(1550, 30, 1650, 30);
  strokeWeight(4);
  line(1550, 50, 1650, 50);
  strokeWeight(8);
  line(1550, 80, 1650, 80);
  strokeWeight(3);
  fill(255);
  rect(900, 10, 50, 50);

  circleOpt(mouseX, mouseY);
}

void colors() {
  //The following code is used to make the boxes for my colors and the drawings stroke if clicked
  strokeWeight(1);
  fill(red);
  rect(10, 10, 50, 50 );
  strokeWeight(1);
  fill(orange);
  rect(60, 10, 50, 50 );
  strokeWeight(1);
  fill(yellowOrange);
  rect(10, 60, 50, 50 );
  strokeWeight(1);
  fill(yellow);
  rect(60, 60, 50, 50 );
  strokeWeight(1);
  fill(yellowGreen);
  rect(10, 110, 50, 50 );
  strokeWeight(1);
  fill(green);
  rect(60, 110, 50, 50 );
  strokeWeight(1);
  fill(blueGreen);
  rect(10, 160, 50, 50 );
  strokeWeight(1);
  fill(blue);
  rect(60, 160, 50, 50 );
  strokeWeight(1);
  fill(violet);
  rect(10, 210, 50, 50 );
  strokeWeight(1);
  fill(pink);
  rect(60, 210, 50, 50 );
  strokeWeight(1);
  fill(white);
  rect(10, 260, 50, 50 );
  strokeWeight(1);
  fill(black);
  rect(60, 260, 50, 50 );
  strokeWeight(1);
  fill(rand);
  rect(10, 310, 50, 50 );
}

//This is the function for my circle drawing tool, when any key is pressed, a circle will be drawn
void circleOpt(float x, float y) {
  if (keyPressed) {
    ellipse(x, y, 50, 50);
  }
}

//This coding allows the drawing lines color to be altered when one of the sqaures of color is pressed
void colorPick() {
  if (mousePressed) {
    if (mouseX > 10 && mouseX < 60) {
      if (mouseY >10 && mouseY < 60) {
        stroke(red);
      }
      if (mouseY>60 && mouseY < 110) {
        stroke(yellowOrange);
      }
      if (mouseY>110 && mouseY<160) {
        stroke(yellowGreen);
      }
      if (mouseY>160 && mouseY<210) {
        stroke(blueGreen);
      }
      if (mouseY>210 && mouseY<265) {
        stroke(violet);
      }
      if (mouseY>265 && mouseY<315) {
        stroke(white);
      }
      if (mouseY>315 && mouseY<365) {
        stroke(rand);
      }
    }
    if (mouseX > 60 && mouseX < 110) {
      if ( mouseY > 10 && mouseY <60) {
        stroke(orange);
      }
      if (mouseY > 60 && mouseY < 110) {
        stroke(yellow);
      }
      if (mouseY > 110 && mouseY < 160) {
        stroke(green);
      }
      if (mouseY >160 && mouseY < 210) {
        stroke(blue);
      }
      if (mouseY > 210 && mouseY <260) {
        stroke(pink);
      }
      if (mouseY >260 && mouseY <310) {
        stroke(black);
      }
    }
    if (mousePressed) {
      if (mouseX > 1550 && mouseX <1650) {
        if (mouseY >10 && mouseY <40) {
          mainStroke= 1;
        }
      }
      if (mouseX > 1550 && mouseX <1650) {
        if (mouseY >40 && mouseY <70) {
          mainStroke= 4;
        }
      }
      if (mouseX > 1550 && mouseX <1650) {
        if (mouseY > 70 && mouseY <100) {
          mainStroke= 7;
        }
      }
      strokeWeight(mainStroke);
    }
    if (mousePressed) {
      if (mouseX > 900 && mouseX <950) {
        if (mouseY > 10 && mouseY <60) {
          background(255);
        }
      }
    }
    //if (mousePressed) {
    // line(mouseX, mouseY, drawX, drawY);
    //}
  }
}

void mousePressed() {
  drawX=mouseX;
  drawY=mouseY;
}

//The following function makes the colorPick(); fucntion draw within the rectangle made in setup
void canvas() {

  if (mouseX>500 && mouseX<1500) {
    if (mouseY>400 && mouseY<1700) {
      if (mousePressed) {
        line(mouseX, mouseY, drawX, drawY);
        drawX=mouseX;
        drawY=mouseY;
      }
      return; // leave
    }
  }
  colorPick();
}//func 
//

```

---

<div class="post-metadata">

### Author: ![WeeBoEtte](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)
#### Post date: [February 28, 2020, 7:41am UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/5 "2020-02-28T07:41:36Z")

</div>

Thank you!!! This is seriously helping me!!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [February 28, 2020, 11:36am UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/6 "2020-02-28T11:36:46Z")

</div>

There are other issues, e.g. with strokeWeight of the 3 lines in the upper right corner

Also, the outline of the buttons changes with the color of the pen. Bad.

**Solution**

You can both avoid when you store the strokeWeight in an int variable and store the color in a variable penColor.

Then you can say `stroke(0); and strokeWeight(1);` at start of draw(), draw the buttons and then say :

```auto
 color(penColor); 
 strokeWeight(penStrokeWeight);

```

when you draw on the canvas with the mouse

---

<div class="post-metadata">

### Author: ![WeeBoEtte](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)
#### Post date: [February 29, 2020, 5:49am UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/7 "2020-02-29T05:49:57Z")

</div>

Thanks for the tips! I really appreciate it, seriously! I’ve been so stressed about this. I’m still getting some issues with it as when I run the program it will no longer change the color of the stroke size line, but it now won’t select color. I’m sure I can get this figured out!

```auto

// class-less version

// Please note that I used heavy inspiration and help from this users own drawing program to create my own: https://www.openprocessing.org/sketch/26614/ by Basil Vendryes

// The folowing program is a very simple drawing program. You can press you mouse key and you will be able to draw a line that follows the mouse.

// You can also change the color of the line, and clear the canvas instantly. 
// You can also press any key on your keyboard and be able to draw an contiuous stream of circles.

float x;
float y;

color red = color(255, 0, 0);
color green= color(0, 255, 0);
color blue= color(0, 0, 255);
color yellow= color(247, 240, 0);
color orange= color(247, 112, 0);
color violet= color(110, 0, 220);
color blueGreen= color(0, 247, 146);
color yellowGreen= color(157, 250, 0);
color pink= color(255, 28, 97);
color yellowOrange= color(255, 159, 3);
color white= color(255);
color black= color(0);
color rand = color(random(255));

float drawX;
float drawY;

float mainStroke= 1;

int penStrokeWeight = 1;
int penColor = 0;
void setup() {

  size(2000, 2000);
  smooth();
  background(255);

//the border for the canvas
  fill(255);
  strokeWeight(4);
  rect(500, 400, 1000, 1300);
  
  rect(0,0,200,500);
  rect(0,0,1800,200);
  

}

void draw() {

  stroke(0);
  strokeWeight(1);
  line(1550, 30, 1650, 30);
  color(penColor); 
 strokeWeight(penStrokeWeight);
  
  // stroke(0); 
  // strokeWeight(1);

  colors();

  canvas();
  

  //I will make the options for different sizes to draw and the clearing option for the canavas as a rectangle
  line(1550, 30, 1650, 30);
  strokeWeight(4);
  line(1550, 50, 1650, 50);
  strokeWeight(8);
  line(1550, 80, 1650, 80);
  strokeWeight(3);
  fill(255);
  rect(900, 10, 50, 50);

  circleOpt(mouseX, mouseY);
}

void colors() {
  //The following code is used to make the boxes for my colors and the drawings stroke if clicked
  strokeWeight(1);
  fill(red);
  rect(10, 10, 50, 50 );
  strokeWeight(1);
  fill(orange);
  rect(60, 10, 50, 50 );
  strokeWeight(1);
  fill(yellowOrange);
  rect(10, 60, 50, 50 );
  strokeWeight(1);
  fill(yellow);
  rect(60, 60, 50, 50 );
  strokeWeight(1);
  fill(yellowGreen);
  rect(10, 110, 50, 50 );
  strokeWeight(1);
  fill(green);
  rect(60, 110, 50, 50 );
  strokeWeight(1);
  fill(blueGreen);
  rect(10, 160, 50, 50 );
  strokeWeight(1);
  fill(blue);
  rect(60, 160, 50, 50 );
  strokeWeight(1);
  fill(violet);
  rect(10, 210, 50, 50 );
  strokeWeight(1);
  fill(pink);
  rect(60, 210, 50, 50 );
  strokeWeight(1);
  fill(white);
  rect(10, 260, 50, 50 );
  strokeWeight(1);
  fill(black);
  rect(60, 260, 50, 50 );
  strokeWeight(1);
  fill(rand);
  rect(10, 310, 50, 50 );
}

//This is the function for my circle drawing tool, when any key is pressed, a circle will be drawn
void circleOpt(float x, float y) {
  if (keyPressed) {
    ellipse(x, y, 50, 50);
  }
}

//This coding allows the drawing lines color to be altered when one of the sqaures of color is pressed
void colorPick() {
  if (mousePressed) {
    if (mouseX > 10 && mouseX < 60) {
      if (mouseY >10 && mouseY < 60) {
        stroke(red);
      }
      if (mouseY>60 && mouseY < 110) {
        stroke(yellowOrange);
      }
      if (mouseY>110 && mouseY<160) {
        stroke(yellowGreen);
      }
      if (mouseY>160 && mouseY<210) {
        stroke(blueGreen);
      }
      if (mouseY>210 && mouseY<265) {
        stroke(violet);
      }
      if (mouseY>265 && mouseY<315) {
        stroke(white);
      }
      if (mouseY>315 && mouseY<365) {
        stroke(rand);
      }
    }
    if (mouseX > 60 && mouseX < 110) {
      if ( mouseY > 10 && mouseY <60) {
        stroke(orange);
      }
      if (mouseY > 60 && mouseY < 110) {
        stroke(yellow);
      }
      if (mouseY > 110 && mouseY < 160) {
        stroke(green);
      }
      if (mouseY >160 && mouseY < 210) {
        stroke(blue);
      }
      if (mouseY > 210 && mouseY <260) {
        stroke(pink);
      }
      if (mouseY >260 && mouseY <310) {
        stroke(black);
      }
    }
    if (mousePressed) {
      if (mouseX > 1550 && mouseX <1650) {
        if (mouseY >10 && mouseY <40) {
          mainStroke= 1;
        }
      }
      if (mouseX > 1550 && mouseX <1650) {
        if (mouseY >40 && mouseY <70) {
          mainStroke= 4;
        }
      }
      if (mouseX > 1550 && mouseX <1650) {
        if (mouseY > 70 && mouseY <100) {
          mainStroke= 7;
        }
      }
      strokeWeight(mainStroke);
    }
    if (mousePressed) {
      if (mouseX > 900 && mouseX <950) {
        if (mouseY > 10 && mouseY <60) {
          background(255);
            fill(255);
  strokeWeight(4);
  rect(500, 400, 1000, 1300);
        }
      }
    }
    //if (mousePressed) {
    // line(mouseX, mouseY, drawX, drawY);
    //}
  }
}

void mousePressed() {
  drawX=mouseX;
  drawY=mouseY;
}

//The following function makes the colorPick(); fucntion draw within the rectangle made in setup
void canvas() {

  if (mouseX>500 && mouseX<1500) {
    if (mouseY>400 && mouseY<1700) {
      if (mousePressed) {
        line(mouseX, mouseY, drawX, drawY);
        drawX=mouseX;
        drawY=mouseY;

      }
      return; // leave
    }
  }
  colorPick();
}//func 
//

```

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [February 29, 2020, 2:44pm UTC](https://discourse.processing.org/t/it-wont-select-colors-or-stroke-weight-when-i-make-the-draw-program-only-draw-in-a-specific-area/18122/8 "2020-02-29T14:44:57Z")

</div>

continued here [Stroke weight selection Help](https://discourse.processing.org/t/stroke-weight-selection-help/18242)
