public static ColorXYZ rgb2xyz(int rgb) {
		ColorXYZ xyz = new ColorXYZ();
		int r = (rgb & 0xff0000) >> 16;
		int g = (rgb & 0xff00) >> 8;
		int b = (rgb & 0xff);
		if ((r == 0) && (g == 0) && (b == 0)) {
			xyz.x = 0;
			xyz.y = 0;
			xyz.z = 0;
		} else {
			xyz.x = (0.490 * r + 0.310 * g + 0.200 * b) / (0.667 * r + 1.132 * g + 1.200 * b);
			xyz.y = (0.117 * r + 0.812 * g + 0.010 * b) / (0.667 * r + 1.132 * g + 1.200 * b);
			xyz.z = (0.000 * r + 0.010 * g + 0.990 * b) / (0.667 * r + 1.132 * g + 1.200 * b);
		}
		return xyz;
	}