public double getPixel(int x, int y, int color) {
		x = x - 1;
		y = y - 1;

		int rgb = img.getRGB(x, y);
		Color col = new Color(rgb);
		double c;

		switch (color) {
		case 0:
			c = col.getRed();
			break;
		case 1:
			c = col.getGreen();
			break;
		case 2:
			c = col.getBlue();
			break;
		default:
			c = 0;
		}

		return c / 255.;
	}