private synchronized static int allocateColix(int argb) {
		// double-check to make sure that someone else did not allocate
		// something of the same color while we were waiting for the lock
		if ((argb & 0xFF000000) != 0xFF000000)
			throw new IndexOutOfBoundsException();
		for (int i = colixMax; --i >= Graphics3D.SPECIAL_COLIX_MAX;)
			if (argb == argbs[i])
				return (short) i;
		if (colixMax == argbs.length) {
			int oldSize = argbs.length;
			int newSize = oldSize * 2;
			int[] t0 = new int[newSize];
			System.arraycopy(argbs, 0, t0, 0, oldSize);
			argbs = t0;

			if (argbsGreyscale != null) {
				t0 = new int[newSize];
				System.arraycopy(argbsGreyscale, 0, t0, 0, oldSize);
				argbsGreyscale = t0;
			}

			int[][] t2 = new int[newSize][];
			System.arraycopy(ashades, 0, t2, 0, oldSize);
			ashades = t2;

			if (ashadesGreyscale != null) {
				t2 = new int[newSize][];
				System.arraycopy(ashadesGreyscale, 0, t2, 0, oldSize);
				ashadesGreyscale = t2;
			}
		}
		argbs[colixMax] = argb;
		if (argbsGreyscale != null)
			argbsGreyscale[colixMax] = Graphics3D.calcGreyscaleRgbFromRgb(argb);
		colixHash.put(argb, colixMax);
		return colixMax++;
	}