Skip to content

Instantly share code, notes, and snippets.

@philpill
philpill / index.html
Created Jun 20, 2014
A Pen by philpill.
View index.html
<script type="text/javascript">
(function(){function f(e){var t={r:0,g:0,b:0};var n=1;var r=false;var i=false;if(typeof e=="string"){e=M(e)}if(typeof e=="object"){if(e.hasOwnProperty("r")&&e.hasOwnProperty("g")&&e.hasOwnProperty("b")){t=l(e.r,e.g,e.b);r=true;i=String(e.r).substr(-1)==="%"?"prgb":"rgb"}else if(e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("v")){e.s=k(e.s);e.v=k(e.v);t=d(e.h,e.s,e.v);r=true;i="hsv"}else if(e.hasOwnProperty("h")&&e.hasOwnProperty("s")&&e.hasOwnProperty("l")){e.s=k(e.s);e.l=k(e.l);t=h(e.h,e.s,e.l);r=true;i="hsl"}if(e.hasOwnProperty("a")){n=e.a}}n=w(n);return{ok:r,format:e.format||i,r:s(255,o(t.r,0)),g:s(255,o(t.g,0)),b:s(255,o(t.b,0)),a:n}}function l(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function c(e,t,n){e=E(e,255);t=E(t,255);n=E(n,255);var r=o(e,t,n),i=s(e,t,n);var u,a,f=(r+i)/2;if(r==i){u=a=0}else{var l=r-i;a=f>.5?l/(2-r-i):l/(r+i);switch(r){case e:u=(t-n)/l+(t<n?6:0);break;case t:u=(n-e)/l+2;break;case n:u=(e-t)/l+4;break}u/=6}return{h
@philpill
philpill / snippet
Created Jun 16, 2014
Sublime Text console.log(); snippet
View snippet
<snippet>
<content><![CDATA[console.log($1);]]></content>
<tabTrigger>log</tabTrigger>
</snippet>