Hue shifting when you have to work in RGB

I work on the web and usually have access to CSS color, which lets you specify colors in the HSL (hue, saturation, lightness) space . That makes it easy to shift a color to make it redder by nudging the H value toward 0 or to send it closer to purple by moving it toward 360. Recently, I needed to shift hue in <a href="https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/G…