I read the article Algorithm to Switch Between RGB and HSB Color Values
Type RGBColor Red As Byte Green As Byte Blue As Byte End Type Type HS
If you're using .net, why reinvent the wheel?
Dim c = Color.FromArgb(myRed, myGreen, myBlue) Dim h = c.GetHue() Dim s = c.GetSaturation() Dim b = c.GetBrightness()