        If rR = Max Then 
            '{Resulting color is between yellow and magenta} 
            h = (rG - rB) / delta
        ElseIf rG = Max Then 
            '{Resulting color is between cyan and yellow}  
            h = 2 + (rB - rR) / delta 
        ElseIf rB = Max Then 
            '{Resulting color is between magenta and cyan} 
            h = 4 + (rR - rG) / delta 
        End If 
        'end {Chromatic Case} 
    End If 
End Sub 

Public Sub HLSToRGB( _ 
    ByVal h As Single, ByVal s As Singl