Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shadeIt(e,t){(s=rgbToHsv((s=new w3color(e,"")).red,s.green,s.blue)).v=s.v-t;var s=hsvToRgb(s);return(s=new w3color(s)).toHexString()}function w3SetColorsByAttribute(){var e,t,s;for(e=document.getElementsByTagName("*"),t=0;t<e.length;t++)(s=e[t].getAttribute("data-w3-color"))&&(e[t].style.backgroundColor=w3color(s).toRgbString())}function rgbToHsv(e,t,s){e/=255,t/=255,s/=255;var r,a,n=Math.max(e,t,s),i=Math.min(e,t,s),h=n,l=n-i;if(a=0==n?0:l/n,n==i)r=0;else{switch(n){case e:r=(t-s)/l+(t<s?6:0);break;case t:r=(s-e)/l+2;break;case s:r=(e-t)/l+4}r/=6}return{h:r,s:a,v:h}}function hsvToRgb(e){var t,s,r,a=e.h,n=e.s,i=e.v,h=Math.floor(6*a),l=6*a-h,o=i*(1-n),u=i*(1-l*n),f=i*(1-(1-l)*n);switch(h%6){case 0:t=i,s=f,r=o;break;case 1:t=u,s=i,r=o;break;case 2:t=o,s=i,r=f;break;case 3:t=o,s=u,r=i;break;case 4:t=f,s=o,r=i;break;case 5:t=i,s=o,r=u}return"rgb("+255*t+","+255*s+","+255*r+")"}!function(){function e(a,i){return this instanceof e?"object"==typeof a?a:(this.attachValues(function(e){var a,i,h,u,f,c,b,d,g,m,y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This function acts like java Processing's map() | |
function mapMinMax(value,oldMin,oldMax,newMin, newMax) { | |
return (newMax-newMin)*(value-oldMin)/(oldMax-oldMin)+newMin; | |
} |