title: IOS drawing App, change buttoncolor
body: <p>i made a simple drawing App, with a toolpanel which contains a pencil, a paint brush and an eraser. There a 12 different colors to draw with. </p>
  
  <p>Now, i would like the pencil and the paint brush image, change in the color of the active color from the colorpanel. How do I do that?</p>
  
  <p>Something like;</p>
  
  <p>When toolbutton:pencil is pressed, color pencil (image) is color:changecolor. </p>
  
  <p>How to translate this in code? </p>
  
  <p>This is my code for the buttons. </p>
  
  <pre><code>- (IBAction)colorChange:(id)sender
  {
  
    UIButton *PressedButton = (UIButton*)sender;
  
  
  switch (PressedButton.tag) {
      case 0:
          self.drawingView.lineColor = RGB(32, 152, 188);
  
          break;
  
      case 1:
          self.drawingView.lineColor = RGB(33, 114, 177);
  
          break;
  
      case 2:
          self.drawingView.lineColor = RGB(65, 79, 155);
  
          break;
  
      case 3:
          self.drawingView.lineColor = RGB(110, 58, 141);
  
          break;
  
      case 4:
          self.drawingView.lineColor = RGB(195, 26, 126);
                     break;
  
      case 5:
          self.drawingView.lineColor = RGB(228, 36, 40);
  
          break;
  
      case 6:
          self.drawingView.lineColor = RGB(234, 98, 36);
  
          break;
  
      case 7:
          self.drawingView.lineColor = RGB(241, 141, 33);
  
          break;
  
      case 8:
          self.drawingView.lineColor = RGB(252, 199, 19);
  
          break;
  
      case 9:
          self.drawingView.lineColor = RGB(255, 240, 79);
  
          break;
  
      case 10:
          self.drawingView.lineColor = RGB(139, 188, 63);
                     break;
  
      case 11:
          self.drawingView.lineColor = RGB(0, 144, 92);
  
          break;
  
    }
  
  }
  
  - (IBAction)toolChange:(id)sender
  {
  UIButton *toolButton = (UIButton*)sender;
  
  
  switch (toolButton.tag){
      case 0:
          self.drawingView.drawTool = ToolTypePen;
          self.drawingView.lineWidth = 7;
          self.drawingView.lineAlpha = 1.0;
          self.potlood02.hidden=NO;
          self.kwast02.hidden=YES;
          self.gum02.hidden=YES;
          break;
  
      case 1:
          self.drawingView.drawTool = ToolTypePen;
          self.drawingView.lineWidth = 20;
          self.drawingView.lineAlpha = 0.67;
          self.potlood02.hidden=YES;
          self.kwast02.hidden=NO;
          self.gum02.hidden=YES;
          break;
  
      case 6:
          self.drawingView.drawTool = ToolTypeEraser;
          self.drawingView.lineWidth = 20;
          self.potlood02.hidden=YES;
          self.kwast02.hidden=YES;
          self.gum02.hidden=NO;
          break;
     }
   }
  </code></pre>