public void setHls(float hue, float luminance, float saturation) {
		if (saturation == 0) {
			red = green = blue = (int) (luminance * 255.0f + 0.5f);
		} else {
			float h = (hue - (float) Math.floor(hue)) * 6.0f;
			float f = h - (float) Math.floor(h);
			float p = luminance * (1.0f - saturation);
			float q = luminance * (1.0f - saturation * f);
			float t = luminance * (1.0f - (saturation * (1.0f - f)));
			switch ((int) h) {
			case 0:
				red = (int) (luminance * 255.0f + 0.5f);
				green = (int) (t * 255.0f + 0.5f);
				blue = (int) (p * 255.0f + 0.5f);
				break;
			case 1:
				red = (int) (q * 255.0f + 0.5f);
				green = (int) (luminance * 255.0f + 0.5f);
				blue = (int) (p * 255.0f + 0.5f);
				break;
			case 2:
				red = (int) (p * 255.0f + 0.5f);
				green = (int) (luminance * 255.0f + 0.5f);
				blue = (int) (t * 255.0f + 0.5f);
				break;
			case 3:
				red = (int) (p * 255.0f + 0.5f);
				green = (int) (q * 255.0f + 0.5f);
				blue = (int) (luminance * 255.0f + 0.5f);
				break;
			case 4:
				red = (int) (t * 255.0f + 0.5f);
				green = (int) (p * 255.0f + 0.5f);
				blue = (int) (luminance * 255.0f + 0.5f);
				break;
			case 5:
				red = (int) (luminance * 255.0f + 0.5f);
				green = (int) (p * 255.0f + 0.5f);
				blue = (int) (q * 255.0f + 0.5f);
				break;
			}
		}

	}