title: Transparency control with buttons
body: <p>I am trying to create an sketch that shows a primary color, then you control its transparency either with a button or a slider. I am using CntrolP5 library. Problem is, whenever I put the transparency variable into the color() everything gets messed up, and colors do not even appear.   </p>
  
  <p>see code:</p>
  
  <pre><code> import controlP5.*;
  
  ControlP5 cp5;
  
  int transparency;
  color c = color(0, 160, 25);
  color red;
  color green;
  color blue;
  
  
  void setup() {
      size(400, 600);
      gui();
  
      red = color(255, 0, 0, transparency); // WHWENEVER I PUT TRASNPARENCY VALUE DOES NOT WORK
      green = color(0, 255, 0, transparency);
      blue = color(0, 0, 255, transparency);
      noStroke();
      smooth();
  
    }
    // create gui
  void gui() {
  
    cp5 = new ControlP5(this);
  
    // create radio button
  
  
    cp5.addRadioButton("radio")
      .setPosition(40, 200)
      .setItemWidth(20)
      .setItemHeight(20)
      .addItem("red", 0)
      .addItem("green", 1)
      .addItem("blue", 2)
      .setColorLabel(color(255))
      .activate(2)
  
    ;
  
    cp5.addRadioButton("level")
      .setPosition(100, 200)
      .setItemWidth(20)
      .setItemHeight(20)
      .addItem("ONE", 0)
      .addItem("TWO", 1)
      .addItem("THREE", 2)
      .addItem("FOUR", 3)
      .addItem("FIVE", 4)
      .addItem("SIX", 5)
      .addItem("SEVEN", 6)
      .addItem("EIGHT", 7)
      .addItem("NINE", 8)
      .addItem("TEN", 9)
      .setColorLabel(color(255))
      .activate(2)
  
    ;
  
    //add slider bar
  
  
    /* cp5.addSlider("level")
      .setPosition(60,20)
      .setSize(100,20)
      .setRange(0,10)
      .setValue(5)
      .setNumberOfTickMarks(11)
      .setSliderMode(Slider.FLEXIBLE)
      ;*/
  
  }
  
  
  void radio(int theC) {
    switch (theC) {
      case (0):
        c = red;
        break;
      case (1):
        c = green;
        break;
      case (2):
        c = blue;
        break;
  
    }
  }
  
  void level(int theC) {
    switch (theC) {
      case (0):
        transparency = 15;
        break;
      case (1):
        transparency = 13;
        break;
      case (2):
        transparency = 11;
        break;
      case (3):
        transparency = 9;
        break;
      case (4):
        transparency = 7;
        break;
      case (5):
        transparency = 6;
        break;
      case (6):
        transparency = 5;
        break;
      case (7):
        transparency = 4;
        break;
      case (8):
        transparency = 2;
        break;
      case (9):
        transparency = 1;
        break;
  
    }
  }
  
  void draw() {
    background(220);
  
    fill(c); //fill with color
  
    ellipse(200, 400, 100, 100);
  
  }
  </code></pre>