aswartzell.net Alberithm 1.0

int border = 50;
int offset = 80;
int i = 3;
Color[] c = {
  new Color(color(random(0, 255), random(0, 255), random(0, 255))), 
  new Color(color(random(0, 255), random(0, 255), random(0, 255))), 
  new Color(color(random(0, 255), random(0, 255), random(0, 255)))
};

void setup() {
  size(455, 455);
  background(height);
  noStroke();
  c[0].addBox(new Box(border, border*2, width/2-border, height-border*2*2));
  c[1].addBox(new Box(width/2, border*2, width/2-border, height-border*2*2));
  c[2].addBox(new Box(border+offset, border*2+offset, width/2-border-offset*2, height-border*2*2-offset*2));
  c[2].addBox(new Box(width/2+offset, border*2+offset, width/2-border-offset*2, height-border*2*2-offset*2));
}

void draw() {
  background(255);

  c[0].render();
  c[1].render();
  c[2].render();

  textSize(9);
  textAlign(LEFT, CENTER);
  fill(0);
  colorMode(HSB, 360, 100, 100);
  text(c[0].hsb(), border, height-border/2);
  textAlign(RIGHT);
  text(c[1].hsb(), width-border, height-border/2);
  textAlign(CENTER);
  text(c[2].hsb(), width/2, height-border/2);
  colorMode(RGB, 255);
  textAlign(LEFT);
  text(c[0].rgb(), border, border/2);
  textAlign(RIGHT);
  text(c[1].rgb(), width-border, border/2);
  textAlign(CENTER);
  text(c[2].rgb(), width/2, border/2);
}

void mouseDragged() {
  colorMode(HSB, height, width, width);
  if (i<3) {
    if (keyPressed) {
      if (key=='s')
        c[i].saturate(mouseX-pmouseX);
      else if (key=='b')
        c[i].brighten(mouseX-pmouseX);
    }
    else {
      c[i].shift(pmouseY-mouseY);
    }
  }
  colorMode(RGB, 255);
}

void mousePressed() {
  //check if it's in the small squares
  if ((mouseX>border+offset && mouseX<width/2-offset && mouseY>border+offset && mouseY<height-border-offset)||
    (mouseX>width/2+offset && mouseX<width-border-offset && mouseY>border+offset && mouseY<height-border-offset)) 
    i = 2;
  //or the left field
  else if (mouseX>border && mouseX<width/2 && mouseY>border && mouseY<height-border) 
    i = 0;
  //or the right field
  else if (mouseX>width/2 && mouseX<width-border && mouseY>border && mouseY<height-border) 
    i = 1;
  //or in the border
  else {
    c[0].clr = color(random(0, 255), random(0, 255), random(0, 255)); 
    c[1].clr = color(random(0, 255), random(0, 255), random(0, 255)); 
    c[2].clr = color(random(0, 255), random(0, 255), random(0, 255));
  }
}
class Box {

  int x;
  int y;
  int w;
  int h;

  Box(int _x, int _y, int _w, int _h) {
    x = _x;
    y = _y;
    w = _w;
    h = _h;
  }

  boolean isMouseOver() {
    return(mouseX>x && mouseX<x+w && mouseY>y && mouseY<y-w);
  }

}

class Color {

  color clr;
  ArrayList boxes = new ArrayList();

  Color(color _clr) {
    clr = _clr;
  }

  void addBox(Box b) {
    boxes.add(b);
  }

  void render() {
    for (int i = 0; i < boxes.size(); i++) {
      Box b = (Box) boxes.get(i);
      fill(clr);
      rect(b.x, b.y, b.w, b.h);
    }
  }
  
  boolean isMouseOver() {
    int count = 0;
    for (int i = 0; i < boxes.size(); i++) {
      Box b = (Box) boxes.get(i);
      if (b.isMouseOver()) {
        fill(0);
        text(hsb(), border, height-border/2);
        text(rgb(), border, border/2);
        count++;
      }
    }
    return(count > 0);
  }

  String hsb() {
    colorMode(HSB, 360, 100, 100);
    String str = "h"+round(hue(clr))+" s"+round(saturation(clr))+" b"+round(brightness(clr));
    colorMode(RGB, 255);
    return(str);
  }

  String rgb() {
    return("r"+round(red(clr))+" g"+round(green(clr))+" b"+round(blue(clr)));
  }

  void saturate(int n) {
    clr = color(hue(clr), saturation(clr)+n, brightness(clr));
  }
  void brighten(int n) {
    clr = color(hue(clr), saturation(clr), brightness(clr)+n);
  }
  void shift(int n) {
    clr = color(hue(clr)+n, saturation(clr), brightness(clr));
    //loop hue value
    if (hue(clr)==0)
      clr = color(height+n, saturation(clr), brightness(clr));
  }
}