Here you can find the source of hsl2rgb(float h, float s, float l)
public static int[] hsl2rgb(float h, float s, float l)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] hsl2rgb(float h, float s, float l) { float c = (1 - Math.abs(2 * l - 1)) * s; float x = c * (1 - Math.abs((h / 60) % 2 - 1)); float m = l - c / 2; float r1 = 0, g1 = 0, b1 = 0; if (h < 60) { r1 = c;/*from ww w . j a v a 2 s . c om*/ g1 = x; b1 = 0; } else if (h >= 60 && h < 120) { r1 = x; g1 = c; b1 = 0; } else if (h >= 120 && h < 180) { r1 = 0; g1 = c; b1 = x; } else if (h >= 180 && h < 240) { r1 = 0; g1 = x; b1 = c; } else if (h >= 240 && h < 300) { r1 = x; g1 = 0; b1 = c; } else if (h >= 300 && h < 360) { r1 = c; g1 = 0; b1 = x; } return new int[] { (int) ((r1 + m) * 255), (int) ((g1 + m) * 255), (int) ((b1 + m) * 255) }; } }