How to convert RGB to HSB and vice versa?

You can use this to convert into HSB:

hsbValue = HSBType.fromRGB(redValue,greenValue,blueValue)