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
GLSL, and which doesn’t have
HSL. You only get the RGB (red, green, blue) color space. Fortunately, on a previous blog, I had written a post about hue shifting in RGB. I relearned how to do it from that.
So, I’m reproducing the original 2010 post here with added commentary. If you don’t want to read about how this works and just want to mess with a spectrum, here is my
new tool for doing that.
more