public void addColor(PieceColor color, ArrayList<Integer[]> cols)
  {
    int[] newCols = new int[baseColors.length];
    for (int i = 0; i < cols.size(); ++i)
    {
      Integer[] rc = cols.get(i);
      int c = (rc[0] << 16) | (rc[1] << 8) | (rc[2] << 0) | ((rc.length > 3 ? rc[3] : 255) << 24);
      newCols[i] = c;
    }
    
    color.setColors(new Color(cols.get(3)[0], cols.get(3)[1], cols.get(3)[2]), new Color(cols.get(0)[0], cols.get(0)[1], cols.get(0)[2]));
    
    PImage tex = Main.sketch.createImage(image.width, image.height, Sketch.ARGB);

    tex.loadPixels();
    image.loadPixels();

    for (int i = 0; i < tex.width*tex.height; ++i)
    {
      boolean found = false;
      
      for (int j = 0; j < baseColors.length; ++j)
      {
        if (image.pixels[i] == baseColors[j])
        {
          tex.pixels[i] = newCols[j];
          found = true;
        }
      }
      
      if (!found)
        tex.pixels[i] = image.pixels[i];
    }
    
    tex.updatePixels();
    image.updatePixels();
    
    textures.put(color, tex);
  }