Here you can find the source of HSVToRGB(float... hsv)
public static float[] HSVToRGB(float... hsv)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { public static float[] HSVToRGB(float... hsv) { assert (hsv.length >= 3); float h = hsv[0]; if (h < 0f) h += 1f;/*from w w w . j ava2 s . c o m*/ float s = Math.min(Math.max(hsv[1], 0f), 1f); float v = Math.min(Math.max(hsv[2], 0f), 1f); float[] color = new float[4]; int i; float f, p, q, t; if (s == 0f) { color[0] = v; color[1] = v; color[2] = v; return color; } h *= 6f; i = (int) Math.floor(h); f = h - i; p = v * (1 - s); q = v * (1 - s * f); t = v * (1 - s * (1 - f)); switch (i) { case 0: color[0] = v; color[1] = t; color[2] = p; break; case 1: color[0] = q; color[1] = v; color[2] = p; break; case 2: color[0] = p; color[1] = v; color[2] = t; break; case 3: color[0] = p; color[1] = q; color[2] = v; break; case 4: color[0] = t; color[1] = p; color[2] = v; break; default: color[0] = v; color[1] = p; color[2] = q; break; } return color; } }