RGB to HSL Expressions
Posted on: April 1, 2009
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.





September 1st, 2009 at 7:48 am
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
September 14th, 2009 at 8:38 pm
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!
September 15th, 2009 at 10:17 am
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
November 10th, 2009 at 11:12 am
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
November 10th, 2009 at 11:22 am
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?
November 10th, 2009 at 11:53 am
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