se
            rB = Min
            rG = h * (Max - Min) + rB
         End If
      ElseIf (h &lt; 3) Then
         rG = Max
         If (h &lt; 2) Then
            rB = Min
            rR = rB - (h - 2) * (Max - Min)
         Else
            rR = Min
            rB = (h - 2) * (Max - Min) + rR
         End If
      Else
         rB = Max
         If (h &lt; 4) Then
            rR = Min
            rG = rR - (h - 4) * (Max - Min)
         Else
            rG = Min
            rR = (h - 4) * (Max - Min) + r