private static int[] argbToHSV(Raster ras, int x, int y) {
		int[] pixel = ras.getPixel(x, y, (int[]) null);
		float r = pixel[0] / 255f;
		float g = pixel[1] / 255f;
		float b = pixel[2] / 255f;
		float max = Math.max(Math.max(r, g), b);
		float min = Math.min(Math.min(r, g), b);
		float h = 0;
		if (r == max && g >= b) {
			h = ((g - b) / (max - min)) * 60;
		} else if (r == max && g < b) {
			h = (((g - b) / (max - min)) * 60) + 360;
		} else if (g == max) {
			h = (((b - r) / (max - min)) * 60) + 120;
		} else if (b == max) {
			h = (((r - g) / (max - min)) * 60) + 240;
		}
		int s = 0;
		if (max != 0) {
			s = Math.round(((max - min) / max) * 100);
		}
		int v = Math.round(max * 100);
		return new int[] { Math.round(h), s, v };
	}