def hsl2rgb(h, s, l):
    """
    HSL in range 0-1 to rgb in range 0-1 (H-hue, S-saturation, L-lightness)
    """
    # see: http://geekymonkey.com/Programming/CSharp/RGB2HSL_HSL2RGB.htm
    # default
    RGB = [1.0, 1.0, 1.0]

    if l <= 0.5:
        v = l * (1.0 + s)
    else:
        v = l + s - l * s

    if v > 0:
        m = l + l - v
        sv = (v - m ) / v
        h *= 6.0

        sextant = int(h)
        fract = h - sextant
        vsf = v * sv * fract
        mid1 = m + vsf
        mid2 = v - vsf

        if sextant == 0:
            RGB = [v,mid1,m]
        elif sextant == 1:
            RGB = [mid2,v,m]
        elif sextant == 2:
            RGB = [m,v,mid1]
        elif sextant == 3:
            RGB = [m,mid2,v]
        elif sextant == 4:
            RGB = [mid1,m,v]
        elif sextant == 5:
            RGB = [v,m,mid2]

    return RGB