Mother-effing hsl()
mothereffinghsl.com
mothereffinghsl.com
To make matters worse, the hsl color spectrum covers colors that RGB can't represent, so you if you're checking for a particular color the conversion algorithm will throw you back something with a few digits off.
Otherwise yes, hsl rocks!
This is simply false. HSL is a simple deformation of the RGB cube into a cylinder, as you can see in this nice diagram I drew up about a year ago: http://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Hsl...
> conversion algorithm will throw you back something with a few digits off
These are rounding errors, and shouldn’t be especially noticeable. So what?
You are right, what I meant is that you can set h = 200 s = 100% l = 0% and you will get back R = 0, G = 0, B = 0.
> These are rounding errors, and shouldn’t be especially noticeable. So what?
Not to the eye, but for computers it is. Say you want to check if an element has a background color of hsl(100, 30%, 30%) because you set this color before. Well, you can't. I ran into this problem while building http://memela.com and I had to switch to rgb because of this.
Not being supported in IE before IE9 means this is pretty unusable for anything commercial, unfortunately. I mean, we only just got to drop support for IE6...
Which is a shame, since it's pretty neat.
div { background-color: #BADA55; background-color: hsla(74, 64%, 59%, 0.7); }
And then hypothetically you could use a filter to get the alpha color in IE, but then you use AARRGGBB hex notation which kinda defeats the whole purpose.
Might end up rolling this solution into http://css3please.com soon to make it a touch easier.Which means that I will probably use it anyway, just because it's that nice to deal with mentally.
I love the guy and his projects, I'm just saying; let's not discount the amazing work of others ;)
I'm just a bit biased to complement his projects (and feverish work ethic) since I find myself using his work on a daily basis.
I have no idea what the heck that means ... The page appears broken.
Javascript enabled and browser is "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009070811 Red Hat/3.0.12-1.el5_3 Firefox/3.0.12" so I should be fine.
Error Console does report an interesting little tidbit;
Error: color is undefined Source File: http://mothereffinghsl.com/js/script.js Line: 89
The function in question is
function inputchange(e){
var target = e.target;
if (target.id == 'alpha'){
alpha = Math.floor(target.value)/100;
if (alpha === 1){
alpha = undefined;
}
}
if (target.id == 'light'){
var split = color.split('%');
split[1] = split[1].replace(/\d+/, Math.round(target.value));
color = split.join('%');
}
setText();
}Sorry I dont have a full stack trace for you, nor am I inclined to fire up a debugger right now to troubleshoot this any further.
...
page is still stuck at "One sec, bro."
"Mozilla ended support for Firefox 3 on March 30, 2010 with the release of 3.0.19" which is 7 security updates after what you're carrying around.
I'm not the only one who doesn't test it anymore.
I wouldn't be so sure about being fine.
I don't see a statement about browser support on the site or on the submission, but maybe you're referring to the linked blog post? The blog post lists Firefox 3.0+ as a browser that supports hsla, not browser support for the color picker site.