Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var HSL2RGB=(h,s,l)=>{h*=6
- var c=(1-Math.abs(2*l-1))*s
- var r=[,,,].fill(l-c/2);var H=++h|0
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x*(x<=1)+(x>1))*255|0)}
- //HSL all 0-1
- t=(a,b,c)=>{a*=6;b=[c+=b*=c<.5?c:1-c,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];return[b[~~a%6],b[(a|16)%6],b[(a|8)%6]].map(x=>x*255|0)}
- HSLtoRGB=(a,b,c)=>{a*=6;b=[c+=b*=c<.5?c:1-c,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];return[b[~~a%6],b[(a|16)%6],b[(a|8)%6]].map(x=>x*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- c=(1-Math.abs(2*l-1))*sr=[,,,].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x*(x<=1)+(x>1))*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- c=(1-Math.abs(2*l-1))*sr=[,,,].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x*(x<=1)+(x>1))*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- a=b=>b<0?-b:b;c=(1-a(2*l-1))*s;
- r=[,,,].fill(l-c/2)r[H/2%3|0]+=c;
- r[2-H%3]+=a(h%2-1)
- return r.map(x=>(x<=1?x:1)*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- c=(1-Math.abs(2*l-1))*s;r=[,,,].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<=1?x:1)*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- c=(1-Math.abs(2*l-1))*s;r=[,,0].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<=1?x:1)*255|0)}
- 1-Math.abs(2*l-1)
- l<.5?2*l:2-2*l
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- c=(l<.5?2*l:2-2*l)*s;r=[,,0].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<=1?x:1)*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0;l*=2
- c=(l<1?l:2-l)*s;r=[,,0].fill(l/2-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<1?x:1)*255|0)}
- (l<.5?2*l:2-2*l)*s
- (l<.5?l:1-l)*2*s
- l</2
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- c=(l<.5?l:1-l)*2*s;r=[,,0].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<1?x:1)*255|0)}
- (l<.5?l:1-l)
- ((l<.5)--l)
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0 //bad
- c=((l<.5)-l)*2*s;r=[,,0].fill(l-c/2)
- r[H/2%3|0]+=c;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<1?x:1)*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0
- s*=l<.5?l:1-l;r=[,,0].fill(l-s)
- r[H/2%3|0]+=s*2;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x<1?x:1)*255|0)}
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0//
- s*=l<.5?l:1-l;r=[,,0]
- r[H/2%3|0]+=s*2;r[2-H%3]+=Math.abs(h%2-1)
- return r.map(x=>(x+=l-s<1?x:1)*255|0)}
- ((x+=l-s)<1?x:1)
- (x+=l-s<1?x:1)
- HSL2RGB=(h,s,l)=>{h*=6;H=++h|0;r[2]=0
- s*=l<.5?l:1-l
- r[H/2%3|0]=s*2;r[2-H%3]=Math.abs(h%2-1)
- return r.map(x=>((x+=l-s)<1?x:1)*255|0)}
- HSLtoRGB=(h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0;r[2]=0;r[H/2%3|0]=s*2;r[2-H%3]=Math.abs(h%2-1);return r.map(x=>((x+=l-s)<1?x:1)*255|0)}
- HSLtoRGB=(a,b,c)=>{a*=6;b=[c+=b*=c<.5?c:1-c,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];return[b[~~a%6],b[(a|16)%6],b[(a|8)%6]].map(x=>x*255|0)}
- function(a,b,c){a*=6;b=[c+=b*=c<.5?c:1-c,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];return[b[~~a%6],b[(a|16)%6],b[(a|8)%6]]}
- (h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0;r[2]=0;r[H/2%3|0]=s*2;r[2-H%3]=Math.abs(h%2-1);return r.map(x=>((x+=l-s)<1?x:1)*255|0)}
- (a,b,c)=>{a*=6;b=[c+=b*=c<.5?c:1-c,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];return[b[~~a%6],b[(a|16)%6],b[(a|8)%6]].map(x=>x*255|0)}
- (h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0;r[2]=0;r[H/2%3|0]=s*2;r[2-H%3]=Math.abs(h%2-1)*s;return r.map(x=>((x+=l-s)<1?x:1)*255|0)}
- h*=6
- c=(1-Math.abs(2*l-1))*s
- H=++h|0
- r=[,,,].fill(l-c/2);
- r[H/2%3|0]+=c;
- r[2-H%3]+=Math.abs(h%2-1)*c
- return r.map(x=>(x*(x<=1)+(x>1))*255|0)
- h*=6
- s*=l<.5?l:1-l
- H=++h|0
- var r=[0,0,0]
- r[H/2%3|0]=s*2
- r[2-H%3]=Math.abs(h%2-1)*s*2
- return r.map(x=>((x+=(l-s))<1?x:1)*255|0)
- h*=6
- s*=l<.5?l:1-l
- H=++h|0
- var r=[,,0].fill(l-s)
- r[H/2%3|0]+=s*2
- r[2-H%3]+=Math.abs(h%2-1)*s*2
- return r.map(x=>(x<1?x:1)*255|0)
- h*=6
- s*=l<.5?l:1-l
- H=++h|0
- l-=s
- var r=[0,0,0]
- r[H/2%3|0]=2
- r[2-H%3]=Math.abs(h%2-1)*2
- return r.map(x=>(x*s+l<1?x*s+l:1)*255|0)
- h*=6
- s*=l<.5?l:1-l
- H=++h|0
- l-=s
- var r=[2,2,2]
- r[2-H%3]*=Math.abs(h%2-1)
- r[(H/2+2)%3|0]=0
- return r.map(x=>x*s*l*255|0).mapx=>x<1?x:1)
- h*=6
- s*=l<.5?l:1-l
- H=++h|0
- l-=s
- var r=[0,0,0]
- r[H/2%3|0]=2
- r[2-H%3]=Math.abs(h%2-1)*2
- return r.map(x=>(x*s+l<1?x*s+l:1)*255|0)
- h*=6
- s*=l<.5?l:1-l
- H=++h|0
- l-=s
- var r=[0,0,0]
- r[H/2%3|0]=2*s
- r[2-H%3]=Math.abs(h%2-1)*2*s
- return r.map(x=>(x+=l<1?x:1)*255|0)
- (h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0;l-=s;r=[l,l,l];r[H/2%3|0]+=2*s;r[2-H%3]+=Math.abs(h%2-1)*2*s;return r.map(x=>( x <1?x:1)*255|0)}
- (h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0; r=[0,0,0];r[H/2%3|0] =s*2;r[2-H%3] =Math.abs(h%2-1); return r.map(x=>((x+=l-s)<1?x:1)*255|0)}
- (h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0;r=[l-=s,l,l];r[H/2%3|0]+=2*s;r[2-H%3]+=Math.abs(h%2-1)*2*s;return r.map(x=>( x <1?x:1)*255|0)}
- (h,s,l)=>{h*=6;s*=l<.5?l:1-l;H=++h|0;r=[0 ,0,0];r[H/2%3|0] =s*2;r[2-H%3] =Math.abs(h%2-1)*2*s;return r.map(x=>((x+=l-s)<1?x:1)*255|0)}
- HSLtoRGB=(h,s,l)=>{h*=6;
- H=++h|0;s*=l<.5?l:1-l;
- r=[l-=s,l,l];r[H/2%3|0]+=2*s;
- r[2-H%3]+=Math.abs(h%2-1)*2*s;
- return r.map(x=>(x<1?x:1)*255|0)}
- HSLtoRGB=(a,b,c)=>{a*=6;
- b=[c+=b*=c<.5?c:1-c,c-a%1*b*2,c-=b*=2,c,c+a%1*b,c+b];
- return[b[~~a%6],b[(a|16)%6],b[(a|8)%6]].map(x=>x*255|0)}
- (h,s,l)=>{h*=6;H=++h|0;s*=l<.5?l:1-l;r=[l-=s,l,l];r[H/2%3|0]+=2*s;r[2-H%3]+=Math.abs(h%2-1)*2*s;return r.map(x=>x*255)}
- HSLtoRGB=(h,s,l)=>{h=h*6+1;s*=l<.5?l:1-l;r=[l-=s,l,l];r[h/2%3|0]+=2*s;r[2-h%3|0]+=Math.abs(h%2-1)*2*s;return r.map(x=>(x<1?x:1)*255|0)}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement