6, e.g. `E0F` --> `EE00FF`
if(hex.length == 3){
hex = hex.replace(/(.)/g, '$1$1');
}
var r = parseInt(hex.substr(0, 2), 16),
g = parseInt(hex.substr(2, 2), 16),
b = parseInt(hex.substr(4, 2), 16);
var luma = ((r * 299) + (g * 587) + (b * 114)) / 1000;
if (luma > 128) {
return '#' +
((0|(1<<8) + r * (100 - percent) / 100).toString(16)).substr(1) +
((0|(1<<8) + g * (100 - percent) / 100).toString(16)).substr(1) +
((0|(1<<8) + b * (100 - percent) / 100).toString(16)).substr(1);
} else {
return '#' +
((0|(1<<8) + r + (256 - r) * percent / 100).toString(16)).substr(1) +
((0|(1<<8) + g + (256 - g) * percent / 100).toString(16)).substr(1) +
((0|(1<<8) + b + (256 - b) * percent / 100).toString(16)).substr(1);
}
}
function hexToRgb(r,t){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),a=function(){return void 0==this.alpha?"rgb("+this.r+", "+this.g+", "+this.b+")":(this.alpha>1?this.alpha=1:this.alpha<0&&(this.alpha=0),"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")")};return void 0==t?n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),toString:a}:null:(t>1?t=1:0>t&&(t=0),n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),alpha:t,toString:a}:null)}function rgbToHex(r,t,n){function a(r){var t=r.toString(16);return 1==t.length?"0"+t:t}if(void 0==t||void 0==n){if("string"==typeof r){var i=/^rgb[a]?\(([\d]+)[ \n]*,[ \n]*([\d]+)[ \n]*,[ \n]*([\d]+)[ \n]*,?[ \n]*([.\d]+)?[ \n]*\)$/i.exec(r);return rgbToHex(parseInt(i[1]),parseInt(i[2]),parseInt(i[3]))}return void 0==r.r||void 0==r.g||void 0==r.b?null:rgbToHex(r.r,r.g,r.b)}var e=r;return"#"+a(e)+a(t)+a(n)}
-->
Employee |
Salary |
|
John Doe |
$1 |
Because that’s all Steve Jobs needed for a salary. |
Jane Doe |
$100K |
For all the blogging she does. |
Fred Bloggs |
$100M |
Pictures are worth a thousand words, right? So Jane x 1,000. |
Jane Bloggs |
$100B |
With hair like that?! Enough said… |
okey oyna
Ankara Eşya Deposu
okey sitesi kurmak
oyun sitesi kurmak
oyun sitesi kurmak
Şartlar ve Koşullar
Gizlilik Politikası