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
The conversion from RGB to HSB should be rather easy using the Color
structure:
Function RGBToHSB(rgb As RGBColor) As HSBColor
Dim c As Color = Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue)
RGBToHSB.Hue = c.GetHue()
RGBToHSB.Saturation = c.GetSaturation()
RGBToHSB.Brightness = c.GetBrightness()
End Function
It doesn't support the reverse, though.