-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.min.js
1 lines (1 loc) · 5.68 KB
/
db.min.js
1
_wallpaperdb_images=[["09305524.jpg","center","#333333"],["67535412.jpg","bottom","#99afd0"],["95686782.jpg","bottom","#351e44"],["93314696.jpg","center","#0f0e0f"],["24543748.jpg","bottom","#2b4b53"],["00139801.jpg","center","#4b4f41"],["16806855.jpg","center","#70567f"],["37320735.jpg","bottom","#343333"],["16309882.gif","center","#131d25"],["39581671.jpg","bottom","#1c1f2d"],["99206040.jpg","bottom","#658aa8"],["63257360.jpg","center","#2b2725"],["01972284.jpg","center","#644e5c"],["03056451.jpg","center","#090e1d"],["80718230.jpg","bottom","#342c4c"],["08038477.jpg","center","#0a0a09"],["22532189.jpg","bottom","#050506"],["07086832.jpg","top","#3b4149"],["11917378.jpg","bottom","#2e2e2e"],["15759723.jpg","bottom","#222222"],["15032996.jpg","bottom","#3a4a4e"],["37994916.jpg","center","#252562"],["63330443.jpg","top","#090e15"],["46199258.jpg","bottom","#2b2932"],["39593777.jpg","bottom","#306bcc"],["47702546.jpg","bottom","#0c051e"],["51280378.jpg","center","#263042"],["61079095.jpg","center","#565776"],["63814927.jpg","center","#45596d"],["42450256.jpg","bottom","#645c80"],["14815894.jpg","center","#6a7482"],["95243003.jpg","bottom","#163b64"],["16978868.jpg","center","#c79156"],["95223720.jpg","center","#1a1828"],["77421788.jpg","center","#7b7a7a"],["88649564.jpg","center","#b4bbb8"],["88093858.jpg","bottom","#d3e393"],["00939591.jpg","center","#262d41"],["13838368.jpg","center","#544444"],["14269512.jpg","center","#6689d6"],["37882132.jpg","bottom","#e8e4e7"],["38920979.jpg","bottom","#81a7c3"],["39850828.jpg","center","#51698b"],["50989454.jpg","top","#886647"],["57231197.jpg","bottom","#282635"],["91853601.jpg","bottom","#25065b"],["03081592.jpg","bottom","#8a9292"],["15877230.jpg","center","#070b16"],["25528122.jpg","bottom","#0c0b0b"],["29656367.jpg","center","#3c6bc8"],["38184232.jpg","bottom","#4883bb"],["60374209.jpg","center","#7e4c53"],["45325963.jpg","bottom","#2b4f5e"],["16714762.jpg","center","#1c0b1d"],["62639926.jpg","bottom","#e7e6e6"],["65354463.jpg","bottom","#e5e9ed"],["29852903.jpg","center","#131313"],["66539241.jpg","center","#b64a04"],["28076516.jpg","center","#e0e0e0"],["73822546.jpg","bottom","#547689"],["80768085.jpg","bottom","#12172b"],["44632291.jpg","center","#383a28"],["97469752.jpg","center","#bc4934"],["02530621.jpg","center","#868686"],["07866639.jpg","center","#5c6a85"],["02642756.jpg","center","#0c0e22"],["66554960.jpg","center","#cfcdbb"],["75100330.jpg","bottom","#2b2d3b"],["40473882.jpg","center","#142e4a"],["16845918.jpg","center","#520031"],["18027342.jpg","center","#334272"],["90606624.jpg","center","#3d316d"],["30915665.jpg","bottom","#47498e"],["31865394.jpg","bottom","#df7596"],["60480110.jpg","center","#0f3977"],["16310424.jpg","center","#668bb0"],["16304323.jpg","center","#d8e4dc"],["58763802.jpg","center","#1d1d1a"],["64402687.jpg","center","#425396"],["96494556.jpg","center","#4f312a"],["93487592.jpg","center","#37283e"],["24952843.jpg","center","#040404"],["03299959.jpg","center","#27213d"],["03935937.jpg","bottom","#8b697e"],["83984226.jpg","top","#741e27"],["28076516.jpg","center","#171006"],["42860664.jpg","center","#636a87"],["94936130.jpg","center","#0c0909"],["97039416.jpg","bottom","#cdcece"],["12262224.jpg","bottom","#8fa6b6"],["08760783.jpg","bottom","#040a0d"],["33459034.jpg","center","#8b8278"],["42501581.jpg","bottom","#304e63"],["16306154.jpg","center","#2e2827"],["16304167.jpg","bottom","#1e1e1e"],["25834954.gif","center","#0c2959"],["72490260.jpg","center","#7f997c"],["05327721.jpg","top","#4e4f6f"],["19489238.jpg","bottom","#96969f"],["27241217.jpg","center","#0d0d1c"],["31534692.jpg","bottom","#65644a"],["45125712.jpg","center","#b9814c"],["16301851.jpg","center","#282a2a"],["82884717.jpg","bottom","#c26684"],["88649909.jpg","center","#1f1e32"],["14732961.jpg","center","#bfb9b6"],["20113328.jpg","center","#2d529b"],["37809603.jpg","center","#696868"],["81749653.jpg","bottom","#84a39a"],["29017875.jpg","center","#373d38"],["48432526.jpg","bottom","#3c3c3c"],["59942285.jpg","center","#1e211c"],["89174898.jpg","center","#0f3574"],["15579380.jpg","bottom","#8e9fa9"],["15579382.jpg","center","#a7aaaf"],["23542276.jpg","center","#725f62"],["32064937.jpg","top","#4a4c46"]];let wallpaper_db={color:"",image:"",index:-1,position:""};function wallpaper_db_query_color(b,a,d,c){if(!d){d=wallpaper_db.color}if(d.hasOwnProperty("toHexString")){d=d.toHexString()}let $wcolor=b(d);let $wbright=$wcolor.getBrightness();let $less_than_target=$wbright<a;let $i;let $factor=1;for($i=1;$i<=200;$i+=1){let $ci=b(d);if($less_than_target){$ci.brighten($factor)}else{$ci.darken($factor)}let $dc=Math.abs($ci.getBrightness()-a);if($dc>50){$factor+=15}else{if($dc>25){$factor+=10}else{if($dc>10){$factor+=1}else{if($dc>5){$factor+=0.5}else{if($dc>1){$factor+=0.25}else{if($dc>0.5){$factor+=0.125}else{$factor+=0.1}}}}}}if(($less_than_target&&$ci.getBrightness()>=a)||(!$less_than_target&&$ci.getBrightness()<=a)){$wcolor=$ci;break}}if(c){console.log("Updating color from brightness "+$wbright.toString()+" to "+$wcolor.getBrightness().toString()+" in "+$i.toString()+" iterations")}return $wcolor}function wallpaper_db_random_blur(a,c,b){if(Math.random()<=c/100){for(let i=0;i<100;i++){let blur=parseInt(Math.random()*100);if(blur>=b[0]&&blur<=b[1]){if(a[0]==="#"){a=a.substring(1)}document.getElementById(a).style.filter="blur("+blur+"px)";document.getElementById(a).style.transform="scale(1.05)"}}}}function wallpaper_db_set_image(a){if(a===undefined||a===null||a<0||a>=_wallpaperdb_images.length){a=Math.floor(Math.random()*_wallpaperdb_images.length)}wallpaper_db.image="https://github.ppizarror.com/wallpaper-db/img/"+_wallpaperdb_images[a][0];wallpaper_db.position=_wallpaperdb_images[a][1];wallpaper_db.color=_wallpaperdb_images[a][2];wallpaper_db.index=a}wallpaper_db_set_image();