Hi I am looking for a tool to convert between HSL color to RGB. HSL is not a very widely used so I am not having much luck googling for a converter.
If you know of one, or an easily implementable algorithm it would be much appreciated.
Hi I am looking for a tool to convert between HSL color to RGB. HSL is not a very widely used so I am not having much luck googling for a converter.
If you know of one, or an easily implementable algorithm it would be much appreciated.
The article for HSL and HSV on the wikipedia contains some formulas. The calculation are a bit tricky, it might be useful to take a look at existing implementations.
You can take a look at the Wikipedia's entry on HSL. There is a section that describes how the conversion from and to RGB can occur.
Just noticed that the less.js project has a number of colour manipulation functions, including hsl_to_rgb:
http://github.com/cloudhead/less.js/blob/master/lib/less/functions.js