docs: public void addKnot(int x, int color, int type) {
  		int[] nx = new int[numKnots+1];
  		int[] ny = new int[numKnots+1];
  		byte[] nt = new byte[numKnots+1];
  		System.arraycopy(xKnots, 0, nx, 0, numKnots);
  		System.arraycopy(yKnots, 0, ny, 0, numKnots);
  		System.arraycopy(knotTypes, 0, nt, 0, numKnots);
  		xKnots = nx;
  		yKnots = ny;
  		knotTypes = nt;
  		// Insert one position before the end so the sort works correctly
  		xKnots[numKnots] = xKnots[numKnots-1];
  		yKnots[numKnots] = yKnots[numKnots-1];
  		knotTypes[numKnots] = knotTypes[numKnots-1];
  		xKnots[numKnots-1] = x;
  		yKnots[numKnots-1] = color;
  		knotTypes[numKnots-1] = (byte)type;
  		numKnots++;
  		sortKnots();
  		rebuildGradient();
  	}