RGB to HSL Expressions
This was an area that I couldn’t find much reference on, so I researched it myself with the goal of making a lesson about it: the rgbToHsl and hslToRgb expressions. This After Effects tutorial uses Radio Waves to show the usefulness of these powerful expressions.
6 Responses to “RGB to HSL Expressions”

Hi Harry
Just having a look but this tutorial doesn’t appear to be working? Tried it in Chrome, IE7 and Firefox? Hope you can help. Cheers man.
Dave
Oddly, I couldn’t get the video to play, either. Tried in both Safari and Firefox. I checked several other tutorials on your site to be sure and they all played perfectly.
Thanks for your great work!
Sorry.. it’s a Flash issue. I need to re-encode this file. In the mean time, use this:
http://www.graymachine.com/media/rgb2hsl.mov
Hey, I liked the tutorial, but it didn’t work for me. By that I mean the colors never change. I know I did the tut correctly, in fact, I did it twice to be certain. The slider numbers change when I scrub the timeline, but… nada.
Any thoughts?
Graham
OK, I don’t understand why your tutorial worked, but I got it to work for me. Tell me how this solution is correct: To get your hue shift, you set the hsl value to hsl = hsl + [hue,0,0]. The part in braces is hue value = x, saturation = 0 and brightness = 0. Well, by how I look at it, a saturation value of 0 in hsl terminology is white. Thus I’d see no color variation, which is what I experienced. When I changed the variable to hsl = hsl + [hue,1,0] everything started working. How is that possible?
Keep in mind, you are ADDING values not just setting them equal to something. There is huge difference between these two ideas:
hsl = hsl + [.5, 0, 0]
and
hsl = [.5, 0, 0]
The latter would be 180º hue, and 0 saturation and lightness. The first one would be the existing color, plus 180º but no change in saturation or lightness.
What is the initial color you are using? Can you email your final project? harry ( at ) graymachine.com