There's some code ( not BMax, but should be easy enough to follow ) here to convert back and forth between RGB and HSV, so I guess you could convert to HSV, change the hue and convert back to RGB?
http://www.cs.rit.edu/~ncs/color/t_convert.html
http://www.cs.rit.edu/~ncs/color/t_convert.html