Here you can find the source of hsl2rgb(int[] hsl)
static int[] hsl2rgb(int[] hsl)
//package com.java2s; //License from project: Apache License public class Main { static int[] hsl2rgb(int[] hsl) { double h = hsl[0] / 360d; double s = hsl[1] / 100d; double l = hsl[2] / 100d; double r = 0d; double g = 0d; double b; if (s > 0d) { if (h >= 1d) { h = 0d;/*from w w w . j ava 2 s . co m*/ } h = h * 6d; double f = h - Math.floor(h); double a = Math.round(l * 255d * (1d - s)); b = Math.round(l * 255d * (1d - (s * f))); double c = Math.round(l * 255d * (1d - (s * (1d - f)))); l = Math.round(l * 255d); switch ((int) Math.floor(h)) { case 0: r = l; g = c; b = a; break; case 1: r = b; g = l; b = a; break; case 2: r = a; g = l; b = c; break; case 3: r = a; g = b; b = l; break; case 4: r = c; g = a; b = l; break; case 5: r = l; g = a; break; } return new int[] { (int) Math.round(r), (int) Math.round(g), (int) Math.round(b) }; } l = Math.round(l * 255d); return new int[] { (int) l, (int) l, (int) l }; } }