void rgbToHsv() {
		int r = rgb >> 16;
		int g = (rgb >> 8) & 0xff;
		int b = rgb & 0xff;

		// Value
		value = Math.max(r, Math.max(g, b));

		// Saturation
		int mini = Math.min(r, Math.min(g, b));
		if (value == 0) {
			saturation = 0;
		} else {
			saturation = (int) ((float) (value - mini) / (float) value * 255.f);
		}

		// Hue
		if (saturation == 0) {
			hue = 0;
		} else {
			float cr = (float) (value - r) / (float) (value - mini);
			float cg = (float) (value - g) / (float) (value - mini);
			float cb = (float) (value - b) / (float) (value - mini);

			float _hue = 0;
			if (value == r) {
				_hue = cb - cg;
			}
			if (value == g) {
				_hue = 2 + cr - cb;
			}
			if (value == b) {
				_hue = 4 + cg - cr;
			}

			_hue *= 60;
			if (_hue < 0) {
				_hue += 360;
			}

			hue = (int) (_hue);
		}
	}