void hsvToRgb() {
		// no saturation means it's just a shade of grey
		if (saturation == 0) {
			rgb = (value << 16) | (value << 8) | value;
		}

		float f = (hue) / 60.f;
		f = f - (float) Math.floor(f);

		float s = saturation / 255.f;
		int m = (int) (value * (1 - s));
		int n = (int) (value * (1 - s * f));
		int k = (int) (value * (1 - s * (1 - f)));

		switch (hue / 60) {
		case 0:
			rgb = (value << 16) | (k << 8) | m;
			break;
		case 1:
			rgb = (n << 16) | (value << 8) | m;
			break;
		case 2:
			rgb = (m << 16) | (value << 8) | k;
			break;
		case 3:
			rgb = (m << 16) | (n << 8) | value;
			break;
		case 4:
			rgb = (k << 16) | (m << 8) | value;
			break;
		case 5:
			rgb = (value << 16) | (m << 8) | n;
			break;
		default:
			rgb = 0; // invalid hue
			break;
		}
	}