I\'ve had a look at the ColorSpace class, and found the constant TYPE_HLS
(which presumably is just HSL in a different order).
Can I use this const
Most of the given answers here seem to assume that HSL == HSB, which is false. The HSB colorspace is useful (and used) in many cases, but there is one notable exception: CSS. The non-RGB css color functions, hsl() and hsla() are HSL, not HSB. As such, it is very useful to be able to convert to and from HSL in java.
There is a good writeup about the problem here: http://tips4java.wordpress.com/2009/07/05/hsl-color/ TL;DR: the code is here: http://www.camick.com/java/source/HSLColor.java
The methods therein are pretty easy to extract if you don't want to use the whole class.
It doesn't appear that the author of the class included a license, though the context of the blog post seems to imply public domain. Use your own judgement.